Ludwig II focused a lot of his attention and most of his money (and millions that he borrrowed) on building wonderfully elaborate castles all around Bavaria, such as Schloss Neuschwanstein, pictured here: https://upload.wikimedia.org/wikipedia/commons/b/b3/Neuschwanstein_Castle.jpg.
Of course, after completing some of these projects and before embarking on new ones, he was deposed on the grounds of being of poor mental health. This was however done without an actual diagnosis based on examining Ludwig and had a lot to do with him threatening to remove the current cabinet (members of which conspired to produce a document "proving" his insanity).
So, was it just that, a political move in a power struggle? Or was his behavior deemed strange long before his deposition, rather than just monetarily irresponsible? What role did king of Bavaria play in politics at the time and what was the political fallout of his deposition? How did the press and the public at large react?
From an earlier answer of mine
The question of Ludwig II's mental health is a very grey area with no clear answer. Ludwig II had exhibited a number of erratic and odd behavior which his deposition concluded he suffered from an advanced state of insanity which many have since construed as schizophrenia. The Third Reich would further popularize this alleged madness as the Wittelsbach were not friends of the new regime. However, the lead physician of the deposition, Bernhard von Gudden, never once consulted the actual patient. Der Spiegel's article is correct in that von Gudden's report met in secret and many of its interviews were secret. It goes without saying that a deposition of a monarch is a highly politicized affair and Bismarck warned against a secret deposition that it could look like a palace coup.
Ludwig II's instability and violent outbursts are a matter of record. There were a number eyewitnesses of him dressing as Louis XIV and or boxing the ears of servants that displeased him. Modern psychiatrists looking at the evidence collected by von Gudden tend not agree with the diagnosis of schizophrenia or extreme delusions. Förstl et. al argues on the basis of Ludwig's autopsy and the deposition evidence that Ludwig may have been schizotypal. Haffner argues that some of his eccentric behavior may have stemmed from brain injuries due to meningitis contracted as a child. Christopher McIntosh, one of Ludwig II's biographers, puts forward the theory that advanced syphilis would have explained his behavior.
You have to keep in mind that these diagnoses are all conjecture and replicate much of the same original sin of von Gudden of relying upon hearsay evidence. Ludwig II towards the end of his life did act in an unusual manner and this behavior alienated a number of people within his household. It is impossible to say whether or not they exaggerated or told the truth during the deposition.
It is also important to contextualize Ludwig II's castle mania with wider political developments and the new Reich Bavaria became a component of. Nineteenth-century monarchs sought legitimation through building projects and Bavaria was no exception. Ludwig II's grandfather, Ludwig I erected two quite famous neoclassical monuments, Walhalla and the Befreiungshalle. Ludwig II's castle-building was expensive and somewhat unprecedented, but it was his erratic behavior that caused concern. Prior exercises in the "cult of monarchy" via pageantry associated with celebrating new buildings or anniversaries of older ones were not viable when Ludwig II made himself a recluse from wider Bavarian society. Ludwig II was absent the celebrations of the Wittelsbach's 700th jubilee, leaving his uncle Prince Luitpold to chair the festivities. The King's reclusive nature, along with his erratic behavior in private, became a real problem for the Wittelsbach court because it meant the state paid an excessive amount of money for these projects without receiving any commiserate benefit. This was particularly troubling because the unification of Germany put the various German monarchs in an awkward position. They were nominally part of a federal dynastic union, but the Prussian-centric system erased much of their actual political power. Moreover, modernizing trends such as universal male suffrage and industrialization made the various princes and kings look like anachronisms. Other contemporaries of Ludwig II reacted to these developments by cultivating a common touch with their subjects and other such forms of "bourgeois monarchy" such as materials emphasizing the middle class domesticity of regal home life. Ludwig II's reclusiveness made such a legitimization strategy near impossible and gave impetus to deposing him. The scandals surrounding Ludwig I's mistress Lola Montez and the popular unrest against the monarchy in 1848 were still within living memory in the 1880s. Tellingly, Prince Luitpold as regent did cultivate a common touch such as as participation in Oktoberfest and wore local costume to present himself as a truly Bavarian monarch. The success of Luitpold's efforts at presenting himself as a monarch/regent of the people helped a good deal to recover the popular legitimacy of the Wittlelsbach dynasty and eased questions about Ludwig II's deposition and death.
Sources
Förstl, H., G. Immler, M. Seitz, and R. Hacker. "Ludwig II, King of Bavaria: a royal medical history." Acta Psychiatrica Scandinavica 118, no. 6 (2008): 499-502.
McIntosh, Christopher. The Swan King: Ludwig II of Bavaria. London: I.B. Tauris, 2012.
Sommer, F. "War das psychiatrische Gutachten B. von Guddens über König Ludwig II. von Bayern korrekt?." Der Nervenarzt 82, no. 5 (2011): 611-617.
As a follow-up, any other examples of regicides/deposings that were noted on grounds of propagandized, while not actually true, insanity?