The number one and main reason is the ice; 20 min. is the sweet spot for resurfacing the ice and an hour is the sweet spot for game length. It used to take quite a while to flood and resurface, so if they were to break it into 15 min. quarters, it would just take too long to run a game from start to completion. By 30 min, the ice is too sloppy. Break the game into three periods and you can resurface ice enough times and keep the between play periods down.
Obviously, now they can resurface ice in a fraction of the time that it used to take (notice that the break between periods is substantially longer than the break before overtime or between overtime periods). They keep the same system and the same period break length because of tradition I guess. Well that and some other reasons.
Keeping the old system provides for two breaks instead of one half-time break like in many sports without a full blown offensive/defensive switch (soccer, rugby, basketball). Generally, hockey shifts are fast and intense, and line changes can happen so fast that you may end up playing 13 min of a 20 min period, but mixed all over the place so you don't get a rest at all. Most sports sub less often and more consistently, but in hockey it's very situational and all over the place. Also, goalies. Hockey goalies tend to be much more active (percentage of playtime wise) than soccer goalies and have to remain in a ready state more often. Period breaks are the only breaks they get usually. Box lacrosse, which functions very similarly to hockey, operates differently because it's so closely related to field lacrosse which requires each team to play goal on each side of the field once as it is an outdoor sport (think football - wind and elements come into effect, the side you score on has impact). Lacrosse goalies also tend to be just the fattest guys who can move moderately quickly (no joke). They remain fairly stationary. Fun fact completely unrelated to everything; when you're first learning lacrosse, the general rule is that your first shot of the game goes straight for the goalies mask. Those fuckers don't move and they take up so much net that you have to put the fear of god into them in hopes that they'll get rattled every time you wind up.