Hot water can end up slightly 'purer' than the cold by the act of heating it, some air will often be released, and some minerals end up being deposited in the WH...so, without those 'extras' in the water, the actual freezing point can be slightly closer to 0-degrees C. That might explain why the hot lead froze.
Preventing it from happening may be harder, though. And, if the pipe froze solid enough, it very well may have damaged the pipe and/or a fitting or two. You may not find out until things melt, though. IOW, it may not leak until it warms up and the ice plug is gone.
Are the pipes going to that shower on an outside wall? Pipes tend to be installed in the middle of the wall, which means there may not be much insulation between them and the exterior surface. And, realizing that insulation only slows the movement of heat, and does not generate it...insulation in the wrong place can make the problem worse.
To save money, many people are lowering their thermostats, and that, along with the exceedingly cold weather much of the USA has been experiencing, frozen supply lines are not uncommon. It's small solace, but you are not alone!
A dripping faucet is constantly introducing above freezing water to a faucet, but with many of today's single-handle shower valves, you have no volume control, so that trick won't work.
The ways to prevent this from happening are to make sure the pipes are closer to the interior wall than the exterior; make sure there are no air leaks (an air leak can quickly freeze a pipe when it's below freezing...doesn't even have to be all that much below freezing), have some flow through the pipe, or add some heat to the pipe (heat tape is one way to do this).
Sometimes, a hot water recirculation system can help, but the cross-over point or return line would need to be close enough to the shower valve to transfer some heat there to avoid freezing...stationary water freezes much faster than moving water, but it's been so cold some places, some streams and waterfalls are in the news, totally frozen up.
Defrosting the line may call for simply raising the thermostat, blowing hot air on the wall, or into the wall, but in a typical shower supply, actually getting to the pipes may be problematic without destroying the shower. If the pipe split, that may be necessary unless you can tear off the exterior wall and approach it from that side. Neither is a happy solution.