Normally to say "it's raining", we use "下雨了". However, according to the subject-verb-object pattern, it seems that it should be "雨下了". Why this is not the case?
Weather expressions and Chinese word order
There are two features of sentences like 下雨了 which make this an interesting question: one is the syntactic structure of the sentence itself; the other is that it is specifically a weather expression, a category which has various unusual properties in many languages.
To begin with, I must disagree with the first line in Becky’s answer: in 下雨了, it makes more sense to view 雨 as the subject than the object.1
Also, to sort-of-correct a partial misconception in the question, remember that the fundamental sentence structure of Chinese is not SVO, but rather topic-comment. SVO is often the default word order, but only when it fits into the topic-comment structure.
The crucial defining feature of a topic is that it must be ‘old information’, something that has already been defined and is known to both speaker and listener in the scope of the current conversation. New information (often presented as indefinite noun phrases) cannot function as topics. This entails that if the subject of a sentence is new information, it cannot appear in topic position (first), and the sentence cannot have SVO word order.
Sentences where the subject is new information have various names; Li & Thompson’s A Functional Chinese Grammar (ch. 17) calls them ‘presentative sentences’, because their purpose is to ‘present’ the subject as well as giving information about what the subject does. There are two basic subtypes: type A, which involve using a semi-pleonastic existential verb, and type B, where the main verb is one of a smallish group of verbs of motion. Both types are verb-initial: the subject (known in this sentence type as the presented subject) occurs after the verb.
In English, presentative sentences of type A function similarly. We tend to use ‘empty’ subject pronouns and put the real subject after the verb: ‘there is a fly in my soup’ rather than ‘a fly is in my soup’. If the subject is old information (≈ definite), and the sentence thus not presentative, we don’t do this: ‘the fly is in my soup’ is fine, but ‘*there’s the fly in my soup’ is ungrammatical as a simple statement of existence (though it can be grammatical in other contexts).
Type B differs between Chinese and English: Chinese has to use an alternative structure to keep the indefinite subject out of topic position, whereas English uses simple SVO (‘a man came in’, not ‘*there came a man in’).2
Let me give a few examples of types A and B:
Type A (existential verb in bold)
院子里 有 一 只 狗
park-in exist one CL dog
there is a dog in the park
有 一 只 狗 在 院子里
exist one CL dog at park-in
there is a dog in the park
Type B (verb of motion in bold)
进来 了 一 只 狗
come-in PFV one CL dog
a dog came in
有 一 只 狗 进来 了
exist one CL dog come-in PFV
a dog came in
(PFV = perfective aspect, i.e., the type of 了 that shows an action is bounded/seen in its totality)
In all these examples, you can see that the subject (一只狗) comes after the verb (有 or 进来). If it came before, it would end up in topic position and would have to be old information, which clashes with the indefinite nature of the phrase. If we remove the indefiniteness, the sentence is no longer presentative, and regular topic-comment structure works fine:
狗 在 院子里 / 狗 进来 了
dog be-at park-in / dog come-in PFV
the dog is in the park / the dog came in
Weather expressions are presentative
This may be surprising to an English speaker, but weather expressions are in fact essentially presentative in nature. That is to say, the default position of a weather expression is that the weather is treated as new information – i.e., it cannot go in topic position in Chinese.
If you think about it, this is sort of true in English as well, but because we use a base verb (or adjective) with an empty pronoun, it’s less obvious. If we convert weather expressions to sentences where the weather phenomenon becomes the subject, however, we can see that we do mostly treat it as new information (indefinite) when first we mention it:
It’s raining = There’s rain coming down / Rain is coming down [not ‘*the rain is coming down’]
It’s windy = There’s wind blowing / Wind is blowing [usually not ‘?the wind is blowing’]
Once we’ve established the weather phenomenon, it becomes old information and can be used definitely, but the initial indefinite use is a prerequisite. A sentence like “The rain was coming down hard” in a novel would be very unusual if it hadn’t previously been mentioned that it was raining.
As mentioned above, only a certain subset of motion verbs can be used clause-initially in type B sentences – but one of them is 下. In other words:
下雨 is a presentative sentence (type B) consisting of motion verb + presentative subject; it is equivalent to ‘rain is falling’ or ‘there is rain falling’ in English.
As Becky correctly notes, the 了 at the end of what you actually asked about, 下雨了, is the type that indicates a ‘currently relevant situation’ (CRS) or ’change of state’, the most frequent use of weather expressions – to show that the currently relevant situation (often in contrast to a previous situation) is rain/wind/whatever. It is possible to make a weather expression bounded (= with a perfective 了), though it often works best if we explicitly specify the indefiniteness:
?下 了 雨
come-down PFV rain
it rained (but it’s not raining anymore)
下 了 一 场 雨
come-down PFV one CL rain
it rained [for a spell]; a spell of rain fell
This also explains why 雨下了 becomes past-like: putting 雨 into topic position like this makes it old information, which makes it definite. The 了 at the end becomes a perfective particle, marking the whole utterance as bounded – that is, the raining is seen as an incident in its totality, meaning it has an identifiable beginning and end. A known, definite entity of rain being viewed in such a way requires that it must have taken place in the past.
1 There are two primary reasons for this: (1) subjects are more inherently linked to verbs than objects, and if a verb has an object, it generally must have a subject too; (2) treating the rain as an object becomes ungrammatical if it’s made definite (*下这场雨下了一整天).
There are some constructions, however, that do seem to treat it more like an object, so it’s not completely cut-and-dry. For example, if we add a complement of degree, an intransitive sentence simply has verb + object + complement (他跑得很快 ~ 雨下得很大), whereas a transitive sentence must either repeat the verb after the object (他跑步跑得很快 ~ 下雨下得很大) or repeat the verb but suppress the original verb (他步跑得很快 ~ 雨下得很大). In this case, 雨下得很大 is the more common construction, but instances of the 下雨下得很大 (which must be transitive) do appear as well.
2 You may note that many other languages side with Chinese here, including several Germanic languages closely related to English. In Danish, for example, the most natural way of saying ‘a man came in’ would be Der kom en mand ind, which literally translates as ‘there came a man in’.
下雨 is a separable verb, which means 下 is the verb and 雨 is the object. Placing the 了 at the end of the sentence vs. after the verb has different meaning.
下雨了。 (It's raining.)
The 了 here is the change-of-state 了 (in fact, this is perhaps the canonical example of a change-of-state 了). It emphasizes how it wasn't raining, but now it is. People say this because this is what people usually want to express.
雨下了。 (It rained.)
There's an ambiguity here:
The 了 here is after the verb 下, so it could be the completion 了, where it expresses how it was raining but is no longer raining.
The 了 here is also at the end of the sentence, so it could also be interpreted as a change-of-state 了 (as above), which is a different meaning (basically the opposite meaning).
I think this is why it feels unnatural as an isolated sentence. To me, 雨下了 feels like it should be part of a longer sentence, such as:
雨下完了。 (It has finished raining.)
雨下了很久。 (It rained for a long time.)
雨滴答滴答地下在了玻璃上。 (The rain pitter-pattered on the glass.)
It could also be used in something more poetic, like:
雨下了，风吹了，鸟叫了，狼吼了。 (The rain rained, the wind blew, the birds chirped, and the wolves howled.)
Here, I wouldn't ascribe 了 as having any particular purpose (maybe it counts as a modal particle); it's used to maintain rhythm in the sentence.
(Thanks to Sage for help with the 滴答滴答 sentence.)