Before 1910, they used to play 2 halves of 30 minutes each. But at the end of each half, the ice was so rutted and covered with snow that it slowed the game way down. So they changed it to 3 periods of 20 minutes each to give them a chance to clean the ice one more time.
It also gave the players more time to rest. They get two 18 minute (as of 2013) intermissions between the periods to rest as opposed to American Football and Basketball, where the really only get one 12 minute halftime to rest because the time between the quarters is only 2 minutes.
As to why they kept it at 3 periods and not change it to 4 quarters? It was probably because 3 periods just seemed to work for them after they changed the rule so they kept it that way.
Also, the only time a team is at a disadvantage is during the 2nd period when they have to do a long change. But because the rinks are the same on both ends, both teams have this disadvantage.