The short answer is: because he basically had to.
Four years before the Meiji Constitution was adopted by Japan, the office of the Prime Minister was created. This office was modified to meet its current description with the establishment of Japan's current Constitution, adopted in 1947 following the Japanese defeat in World War II.
The Prime Minister is appointed by the Japanese Emperor, after first being a member of the Japanese Diet and selected by members of the Diet for the position. This ensures that candidates meet both minimum criteria: at least 25 years old and a non-military civilian. Once officially appointed by the Emperor, the Prime Minister is then the head of the Japanese Government. In order to maintain this position, he must retain the confidence of the House of Representatives, and if the House of Representatives should vote for no confidence in the current Prime Minister, he is then obligated to resign
Yukio Hatoyama was a long-time politician in Japan, joining the House of Representatives in 1986 and becoming the President of the Democratic Party of Japan in 2009. In September of 2009, Hatoyama was appointed the Japanese Prime Minister with a relatively high approval rating, which was also quite short-lived. Several months after his appointment to Prime Minister, in December 2009, Hatoyama was accused of not properly reported funds received as donations, primarily from his mother, but some other reported donators listed were the names of deceased individuals. This was quite scandalous and started the decline in Hatoyama's approval ratings despite prosecutors deciding there was not sufficient evidence to pursue criminal charges.
The ultimate approval rating losses were seen in Hatoyama's dealings with the US military presence, particular on the island of Okinawa. After promising to move the main military, but finding it more difficult, time-consuming, and costly than anticipated, Hatoyama backed down from his promise, only to then come to an agreement with the US to retain the US base on Okinawa for their own security. This was, of course, following the attack on the South Korean naval vessel rather close to home. The Japanese people voiced their dissent and the House of Representatives was likely to move for a vote of no confidence. Hatoyama announced his preemptive resignation on June 2, 2010.
Time Magazine listed Yukio Hatoyama as one of 2010's 100 Most Influential People for his efforts that changed the country of Japan to become a better functioning Democracy. This was before his resignation, however, and the continued progress for Japan's Democratic government will now depend on Hatoyama's successor, Naoto Kan.