There are several ways it can rain instead of snow even when the temperature is below freezing.
It helps to think of the air from clouds to groundas a series of layers, each with its own temperature, and each with the ability to affect falling precipitation.
For example, the cloud may be below freezing temperature, so it will drop snowflakes, but the snowflakes have to pass through other layers before reaching the ground, some of which might be above freezing.
In that case, the snow can turn back into water and hit the ground as rain. Conversely, if the cloud is above freezing, it can drop rain that freezes on its way down through subfreezing layers of air, causing sleet.
Finally, if the lowest level of air next to the ground is the only layer that’s below 32 °F, the raindrops may not have time to freeze before they hit the ground. They will, however, freeze into ice upon landing, producing freezing rain.
This is the stuff that can coat power lines and tree branches, sometimes bringing both crashing to the ground.