Since the beginning of the Meiji Restoration (heck, since before it), there were a few leaders of the movement who expressed their belief that Kyōto was unsuited for an Imperial capital. It was considerably inland and hemmed in by mountains, meaning it had less room to grow and in the new age of of central rule it was not conductive to quick communication. This was especially true as it was expected that they would be receiving a lot of foreigners and the inland Kyōto would increase the time needed. Not only that, Ōkuma Shigenobu wrote in his memoirs that it was recognized the central part a navy would play in the coming age (also keeping in consideration of the still on-going war), while even Hirano Kuniomi, who died in the Bakumatsu turmoil, wrote in 1862 that at the time Kyōto and the imperial palace was completely eclipsed in grandeur by Edo and Edo castle, Edo being one of the largest cities and Edo castle being one of if not the largest castle in the world. It would be an embarrassment after foreigners having gone to and seen Edo to then be told that Kyōto was the seat of government.
Of course just because Kyōto was unsuited to be the new imperial capital doesn't mean it would be Edo. Ōkubo Toshimichi actually chose Ōsaka at first in early 1868. Backlash from the Kyōto aristocrats put that plan on hold, and the emperor only made a trip to Ōsaka. But once Edo surrendered, it quickly became a possibility. It's pretty well known since medieval Japan that due to geographic and population reasons to fully control the country one must control both the Kinai (Kyōto, Nara, Ōsaka and the surrounding) and the Kantō plains. And Edo was the geographic, and after over two centuries of Bakufu rule political and socio-economic, center of the Kantō. The most pressing concern for the new government at this point was that Edo was much closer to the frontlines, and so better suited receiving communications and directing resources, and that the reason Edo was such a large and vibrant city is that it had been the seat of the Bakufu for so long. The Bakufu had required all clans to have hostages and living quarters in the city, driving the country's elites to the city, which fueled growth as merchants and people followed. Now that the Bakufu no longer exists, Edo was running the risk of turning into a backwater, with the accompanying socio-economic instability that was sure to follow if the people of Edo could no longer earn a proper livelihood. So in the autumn of 1868, the emperor accompanied by the highest government officials made a trip to Edo, at which time it was decreed that to keep the city of millions from suffering, to facilitate communication with the outside world and watch over his people, and to show that the emperor cared for as his family the east as well as the west, Edo would be renamed Tōkyō, or "Eastern Capital". The decree also encouraged the people to keep working hard at their jobs and produce goods to keep the city's prosperity. Before returning to Kyōto, to show the emperor/government's commitment to the city it was announced a new imperial palace would be constructed in Edo castle.
Tōkyō was not, and indeed was never, official declared the new capital. Rather, it was made a new capital, meaning there were two, and Kyōto was still a capital. This is to sooth over sentiments of the people of Kyōto and the Kinai, with lots of official announcements explaining the necessity of "temporary excursions" to Tōkyō and assuring the people of Kyōto they were still important. However, since before the trip many leaders expressed the opinion that Tōkyō made for a better center for the government. Besides the above reasons, it was also noted that as the Bakufu's place of government with a residence for every single clan, Tōkyō already had many (now unused) buildings the new government could use for its bureaus and others functions without needing to construct everything from scratch. Also, the Bakufu had already settled the foreign dignitaries in Edo or near-by Yokohama, so this elevated the need to move them. Sanjō Sanetomi went so far as to express (during the 1868 trip) that while moving would shake the faith the people of Kyōto and Settsu (Ōsaka) who had been close to the emperor for thousand years, not doing so would result in the disillusion and hatred of the people of Kantō who had been blessed by the Tokugawa for 300 years, and even if they were to lose Kyōto and Settsu, as long as they had Tōkyō they would not lose control of Japan. And so a second trip to Tōkyō was made in 1869, and the "planned return" postponed, the empress was moved, and one by one government bureaus followed until Tōkyō became the de-facto capital.