I’m a bit confused about the motivations for creating Yugoslavia and why it fell apart. Did something change between 1919 and the 1990s that caused Yugoslavia to not be so desirable anymore?
The formation of Yugoslavia, or the Kingdom of Yugoslavia, was a decision that was rooted within the ethnic values of the region. The idea of Yugoslavia, before it's formation, was entirely in regards to a state which is for all Slavic peoples. At it's formation, following the end of the first world war in 1918, it was known as the Versailles state, or the Kingdom of Serbs, Croats and Slovenes. It's important to understand the ethnic groups within the borders as that is a huge reason as to why the breakup occured near the end of the 20th century.
To understand "what changed" we must analyse the political climate of Yugoslavia. As has been mentioned in other posts on this topic, Yugoslavia was a main front during WWII as the Germans and Italians invaded Yugoslavia in 1941. After the capitulation of the Kingdom of Yugoslavia, two resistance groups formed: the Chetniks, who would eventually side with the Croatian-Nazi sattelite state, and the Yugoslav Partisans; led by Josip Broz Tito. The Partisans would become the largest resistance force in, not just Yugoslavia or Eastern Europe, but the entirety of Europe itself. The Partisans were highly effective in resisting against the Croatian oppressors, the "Ustaše" and we're at the forefront of Anti-Fascism. Tito went from political opponent, to rebel, to leader, to legendary hero within the span of four years from 1941-1945 as battles were won throughout Yugoslavia, culminating in the removal of Fascist forces from the nation and the capitulation of the Independent state of Croatia, a Nazi puppet state set up in 1941. During the period of resistance, a series of "ethnic cleansing" occured against Bosnians and Serbians primarily by the Croatian state. This form of ethnic conflict would not cease for decades to come. By the end of the war, the Yugoslav Partisans became the new ruling political party. Due to the Communist (or at least Far-left) ideology of the group, the Kingdom of Yugoslavia was renamed as the Yugoslav Socialist Federative Republic (Yugoslav SFR). Initially backed by Joseph Stalin, the nation was on course to fully embracing communism and joining the Bloc however in 1948, Stalin and Tito had a falling out which caused immense division between the two leaders. A division which would lead to numerous assassination attempts on Tito by the NKVD (all of which failed and led to a hilarious response from Tito which I suggest looking into) and a constant power struggle between the US and the USSR's influences.
With this political landscape in mind, we also need to understand the economic situation of Yugoslavia. The kingdom of Yugoslavia was not unique in their economic situation; they were an agricultural society which a small middle class and we're mostly dependant on unstable market prices of agricultural exports. Yugoslavia, also similar to many others, was experiencing a great amount of debt which was taken out from the West during the 1920s however the great depression in 1929 caused the West to recall these loans. Yugoslavia was completely unprepared and was unable to pay them back. World war II ended with great unemployment and inflation, both of which were contributing factors within the public's acceptance of communist ideals. The communist party, which Tito led, implemented great economic reforms including the introduction of Workers' Self-management, a Syndicalist policy not seen in many countries up to this point. With this, and the strategies of dealing with unemployment, as being the most unique economic development, many studying the period have cited this as being the reason for the Yugoslav "golden period" of unprecedented economic growth, including David Schweickart and Harold Lydall. However, nothing good lasts forever. The booming economy of the Yugoslav SFR began to suffer in regards to the strategies of dealing with unemployment. This was mainly the idea that the unemployed would emigrate to other places in Europe for work to gain skills and money so they could return wealthier and have the skills to join the workforce. However this failed with regards to other countries being resentful that Yugoslavia was sending unskilled, poor workers to them in mass, so the response was to return them immediately. This caused the plan to backfire as Tito believed it was working, and so he would then send the workers back again, only for the cycle to continue. This caused inflation to become hyper-inflation and this to cause unemployment into mass-unemployment. The economy was getting worse and worse and Tito did not stop his reckless spending. This was slightly alleviated by aid from the USSR and the US as both East and West were vying for influence. However, as the cold war came to a close this aid ended and all loans were called back; which again, Yugoslavia could not repay.
While there are a variety of factors which contributed to the breakup of Yugoslavia, one of the most cited reasons are the ethnic divides and conflicts. Because of the nature of this topic, ethnic conflicts is the hardest to cover in a comprehensive manor and so I will only touch on it lightly so as to not provide any mistakes or do the controversial topic injustice. As a summary, ethnic conflicts was not a recent development as divides had existed for hundreds of years and was a deeply religious and historical experience. However, certain changes did make the conflicts worse from 1945-1991, including ethnic cleansing from Croatia but also increasing nationalism with all states due to a variety of causes. Serbian nationalism was one of the most prolific cases of nationalism. It was rooted in history and politics equally, with one of the reasons for it being the underrepresentation of Serbia within Yugoslavia as they were not counted as a Sovereign state due to their two autonomous republics, Kosovo and Vojvodina. Serbian politician Vesna Pesic stated many Serbians felt "dissatisfaction" and the most plausible reason for this and the growing nationalism was "the constitutional provisions that undermined Serbia's territorial integrity". While Serbia did not receive sovereignty, Kosovo and Vojvodina did. Along with Serbian nationalism, nationalism within other states such as Slovenia and Croatia grew due to the divide between them and the rest of Yugoslavia. These were factors that led to the Balkan wars of the 90s and to the breakup of the nation.
One other factor that many have pointed towards as being the largest reason for the breakup would be the death of Tito. Tito, much like Stalin, was held was a legendary figure who was surrounded by a cult of personality. While Stalin was surrounded by a cult of fear, Tito was surrounded by a cult of love. There were very few who did not feel admiration for the man and this can still be seen in the Yugoslav region on modern times. One commonly cited historian on this topic would be Sabrina Ramet who states that he had a hugely influential cult surrounding him and this can be seen within Serbia, Croatia and Bosnia-Herzegovina today.
Again, the breakup of Yugoslavia is heavily controversial topic which some have stated as solely being the consequence of communism, while others point to it being a combination of factors including the ethnic conflicts of the region, economic decline, the fall of communism and the death of Tito.
Source for reading on Tito's cult of personality: https://www.rferl.org/a/Interview_Tito_Symbol_Of_Better_Times_For_ExYugoslavs_Historian_Says/2032075.html