It if was freezing outside, it was almost certainly colder inside the latch mechanism. It sounds like ice formed on the spring and / or the latch hinge. You were able to use the leverage of the door handle to move the latch against the friction of the ice but then the spring wasn't able to push it back.
When something like this happens, I would suggest either using a heat gun or hairdryer right on the latch or, if that's not feasible, getting in the car with the heater on full blast. At a certain point, the latch will pop loose enough to hold the door closed.
Once the latch is nice and warm, Brian is correct about WD-40 for water displacement (thus the name). The ambient temperatures don't necessarily have to be over freezing but it will help.
Once you feel that the water has moved on, I'd lube the latch liberally with standard white lithium grease. I like lithium grease because (a) it works almost everywhere, (b) it's cheap and (c) it's relatively high visibility (so I can see where it is and where it has rubbed off).