Take for instance The Perfect Storm. Without the storm, it would have never taken place. It was necessary to the action, the storyline and is even a character in the book (yes, it was a book before it was a movie). It's a perfect example of how weather can be used in a story.
On the other hand, there are some scenes that could have done without the weather element. Take Spiderman for instance, the kissing scene in the alleyway. Was it necessary for it to rain? Well, not really, from what I remember. It wasn't a key component of the storyline. It was more for effect. So in that vein, it could have been necessary simply to set the tone.
Writers use weather to set the tone of scenes all the time. In the instance of the Weather Warden series from Rachel Caine (a series that just concluded I might add *weep*) weather is vital as the characters control it. Jo can control and manipulate the elements and save humanity.
How about an example from my work personally? The scene that immediately comes to mind for me is out of Blood Fever, the second of the Rebirth series books. The characters, Quinn and Evande, are standing out in front of Quinn's home and it's pouring. I mean it's raining cats, dogs, rats and frogs. Thunders crashing. Lighting is popping like a firework display on the Forth of July. It's a highly emotional scene for both characters and the weather reflects their emotion. More importantly...the reader learned something and they didn't even know it.
What? You'll just have to wait until this summer to find out when Forged in Fire releases. ;^)
Frustration tightened Quinn's eyes and the corners of his mouth pulled down into a deep frown. “You still don't get it, do you kid?” he shouted over the crack of lightning a few miles away and the thunder that followed. The storm rolled overhead, grumbling in annoyance. It seemed to be offended because we were ignoring it.
“Get what?” I asked him, aggravated because I knew full well what he was talking about, but was still refusing to admit. I couldn't do that to either of us, it just wouldn't be fair. It wouldn't be fair to anyone else either, most especially to Logan and Gina. They were caught up in this too even if neither of them realized it.
“I told you I accepted you years and years ago. No matter how much I swear, it's never going to matter, is it?” Rage edged into his voice.
I wiped my hand over my face as I tried to get the raindrops out of my eyes. “You accept me with conditions, Quinn. It shouldn't be that way.” This was an old song and dance for us.
He reached out and wrapped his hand around my forearm to pull me closer to him. Lighting exploded overhead and backlit his shape. “You know why I do, but you don't want to admit it or listen. To yourself or to me.”