Why is the rectifier necessary in this circuit?
D1 (the bridge rectifier) protects the transformer 6 volt winding from receiving a voltage that could be tens (or maybe hundreds) of volts from "line in". You have to consider that the load (the motor?) may go into a stall condition and without diodes you can't limit the 6V AC voltage. If this rises to say 20V AC, the output from the secondary (called 120V AC) would be stepped up by the turns ratio of the transformer.

The turns ratio is 120/6 = 20 so, with an unrestricted 20V AC fed into the 6V winding, the output voltage would be 400V AC. It could be more under stall conditions. It could fry the relay (K1), destroy the diodes D2 and D3, explode C2 and fry the transformer due to core saturation.