Was it because Moscow was the spiritual capital of the Russians? Was it the British Royal Navy making hugging the coastline too dangerous?
From an earlier answer of mine
Neither Moscow, St. Petersburg. nor any other Russian cities were the primary targets of the French invasion. Napoleon's main goal when he crossed the Niemen River in June 1812 was not to occupy Russian cities but to destroy the Russian armies. Napoleon staked a lot of hope on being able to pin down and crush the main Russian armies with overwhelming force. This was a problematic strategy for a number of reasons. For one, the Grande Armée of 1812 was simply too large and unwieldy to use with the speed required. The battles prior to Borodino followed a typical pattern of the Grande Armée's individual corps making contact but being too far away from their other corps to press on decisively. Secondly, rivalries and hatreds among Napoleon's corps commanders made it very difficult for them to work as a team, and Napoleon's own confused staff work compounded matters. Third, the hot summer weather and terrain made it difficult to conduct speedy operations. The summer march ate into supplies and draft animals and contributed to outbreaks of dysentery and other ailments that wasted away the strength of the Grande Armée.
Finally, one has to give the Russians their due in thwarting Napoleon's plans. The Russian command was polarized between two camps on how to meet the French invasion. The defensive camp centered around War Minister Barclay de Tolly called for fighting a staged delaying action that would exhaust the enemy as it advanced into the interior, where it would be counterattacked by overwhelming force. A more aggressive strategy was championed by the likes of Prince Peter Bagration set the Oder as the final line of French advance and the the Russian army should immediately counterattack once the French invaded. Neither stratagem played out in 1812, but the command paralysis between these two camps encouraged a retreat towards Moscow.
The result was that the two armies that faced each other at Borodino were exhausted and rather less effective than they had been at the start of the campaign in June. Napoleon carried the day, but the Grande Armée was in no shape to pursue the still large remnants of the Russian army. But Moscow appeared before Napoleon as a prize with no real force standing in his way to take it.
Herein lies a sometimes overlooked strategic myopia in Napoleon's grand strategy: he overestimated the importance of taking key cities to military operations. Napoleon sat in Moscow, even after the fires there was a considerable amount of the city left, hoping that this would lead the Tsar to make terms. Moreover, his Bulletins back to France emphasized the importance of Moscow and the glory achieved in capturing it. The city's capture was one of the few bright spots in an otherwise dismal campaign that had achieved relatively little for its efforts and the size of the army. But Napoleon did not possess the supplies to winter in the city and there still was an extremely sizable Russian army in the field, albeit just as damaged as the Grande Armée. Moscow became something of a poisoned chalice for Napoleon; he placed great political stock in occupying it, but he could not keep it. Additionally, recent lessons should have shown him that occupation of a capital did not end wars. Neither the occupation of Madrid in 1808 nor that of Vienna in 1809 ended the wars there. In the following campaign in 1813, Napoleon developed an obsession with taking Berlin in the hopes of knocking Prussia out of the war, but this would not have been the shattering blow he anticipated. Russian forces had occupied Berlin during the Seven Years' War for four days in 1760 and almost again in 1762, and that did not cause Frederick II to abandon the war. If anything, the independent actions of the Prussian army chiefs in the winter of 1812/13 showed that they prioritized defeating the French far more than even loyalty to the Hohenzollern crown.
As for Moscow itself, the retreat of Russian arms caught its governor Rostopchin quite unawares. The latter Russian official had done little to steel the city for either French occupation or resistance. Borodino itself was something of a shock to Rostopchin in that the fighting had gotten so close. It was only the day after Borodino that Kutuzov informed him that he was retreating and even here, the Russian general led the governor to believe that he intended to fight Napoleon on the outskirts of the city. Rostopchin was increasingly skeptical that Kutuzov was telling the whole truth, but he still led the population to believe the city would be a frontline in resistance against the invader. It was only on 13/14 September that Rostopchin ordered the evacuation of the city. While there were long-standing rumors that Moscow's governor set fire to the city, Alexander Mikaberidze's research into the matter has shown that only some of the fires were caused by the evacuation. The chaotic situation caused by the hasty evacuation, Russian demolition of a few works, and especially looting by the Grande Armée's troops led to the massive fires in the city.
Napoleon certainly did claim to have captured Moscow; it was after all the only real notable success of an otherwise frustrating campaign mounted at great expense. But Moscow was fairly useless as a prize if it did not bring any political solution to the war. But this worked against Napoleon. The longer Napoleon occupied Moscow in the hopes for a political settlement that would not come, the greater sway the Bagration camp possessed over the more cautious "foreigners" like Barclay de Tolly. In the meantime, Russian forces blocked Napoleon's alternate escape routes via the Kaluga, so the Grande Armée had to retreat over its own line of advance, which had been twice picked over by the two armies in the summer.