The soda wasn’t frozen as long as it was still in the refrigerator because the refrigerator’s temperature was warmer than its freezing point. But when you pulled the tab you did two things: You released the pressure inside the can and you lost some of the gas. For different reasons, each of these effects helped the liquid to freeze.
Every liquid has a certain temperature at which it will freeze: its freezing point. The freezing point of pure water is 32 degrees Fahrenheit or 0 degrees Celsius. Impure water, water that has any kind of stuff dissolved in it, has a colder freezing point than pure water does. The more stuff is dissolved in the water, the colder its freezing point will be.
Soda pop certainly has a lot of stuff dissolved in it: sugars, flavors, and, especially, carbon dioxide gas. So it won’t freeze until well below 32 degrees Fahrenheit. But as soon as you opened the can, the liquid lost some of its burden of dissolved carbon dioxide gas, which escaped from the liquid and went off into the air. Now containing less dissolved stuff, the liquid’s freezing point becomes warmer than its own temperature from the refrigerator, and it dutifully freezes.
Opening the can and releasing the pressure had another effect as well. Ice occupies more volume than liquid water does. So, if you compress ice it tends to revert to its smaller-volume liquid state; it melts. Under the high-pressure conditions in the closed can, the ice was repressed and remained liquid. But as soon as you released the pressure, the liquid water was free to expand into its higher-volume form: ice. Of course, this couldn’t have happened unless the soda was already colder than its freezing point because it had already lost the gas.
As if that weren’t enough, there was a third effect. When you opened the can, the compressed carbon dioxide gas was able to expand. Whenever a gas expands, it cools. This extra cooling also contributed to the freezing.
Either turn your refrigerator down, that is, turn the temperature up, or don’t open the cans until they’ve warmed up a bit. You can wait.