When the rabies virus is spread to a new host, it first attacks muscle cells, which prevents the host's immune system from recognizing the invasion. Next, it binds to neurons at neuromuscular junction. Rabies virus is neurotropic, thus it binds preferentially to neurons, specifically the acetylcholine receptors on neurons. After binding the neuromuscular junction, it uses retrograde transport to travel up the neuron axon. When the virus reaches the neuron cell body, it rapidly spreads to the central nervous system, where it replicates in motor neurons and quickly reaches the brain. Next, it travels to the peripheral and autonomic nervous system and then finally reaches the salivary glands.
So, why does the rabies virus cause hydrophobia? The virus is accumulated in the salivary glands of the host so that it can be transmitted to the next host, often through wounds inflicted by a bite. As the virus spreads through bites, drinking water or swallowing would decrease transmission (by reducing quantities of infected saliva present in the mouth). To prevent this, the rabies virus causes painful spasms in throat and larynx. This causes saliva production in the host to be greatly increased, and also means that drinking, or even thinking about drinking, causes painful spasms in the throat. Since the muscular movements that occur while drinking are involuntary, and the virus has already infected autonomic nervous system and motor neurons, this is what enables it to control the involuntary muscle movements of throat and larynx in the host. This association of swallowing with the excruciating pain, and an inability to swallow, leading to choking, is what leads to fear of water.
Thus the term 'hydrophobia' in this case is somewhat misleading - bathing or a body of water might wouldn't trigger a hydrophobic response (unless ingestion of water was a possibility), as the fear is more specifically fear of choking on liquids due to impaired swallowing.