It's not a strict rule, it's just that weather forecasters usually use "will", because that is how we normally make predictions. "Going to" is used to indicate that something is definitely going to happen (see, I had to use it there). Sometimes the meanings overlap, because if we say that something is going to happen, that is also a kind of prediction.
So it's normal for a weather forecaster to say, "It will rain...", but other forms are possible. In your example, the speaker is so sure that it is going to rain that he turns the weather forecaster's prediction into a certainty. "Going to" very often also indicates that we expect something to happen in the very near future, usually because we can see the evidence already. If you point to a sky full of black clouds, you're more likely to say, "It's going to rain," because it's almost 100% certain.