Why does Idaho have two time zones?

It is not two states at all. The state of Idaho, when it was formed, was controversial as the people in the north of the state wanted to be a part of Montana or Washington state. This didn't happen however, as we know.

The state, although being one state, has two distinct population groups - those in the south who are proud Idahoans and those in the north who commercially identify with Washington state. Those in the north therefore follow the timezone of Washington state (Pacific time) and those in the south follow the true timezone for the state, which is Mountain time.