Why don’t Slovenia and Croatia unite?
There was a possibility of Croatia and Slovenia uniting, having a common religion, sharing a border, both being Slavs and generally having amiable relations, but the biggest hurdle was language.
The standard Croatian and Slovene languages aren’t mutually intelligible, which is why a union never happened unless you count Yugoslavia and the State of Serbs, Croats and Slovenes.
If the Croatian writers of the 19th century chose to base the language on the Kaikavian dialect, we might have seen an union of Croatia and Slovenia, but that might have disenfranchised some southern Croats who speak the Shtokavian dialect, although there are some doubts about that since those people already declared as Croats, plus the Kaikavian Croats up north didn’t get mad when Shtokavian was chosen as the main dialect and if they did get infuriated with the decision, it didn’t cause a major upset to the point where it changes borders. The legitimate argument for choosing Kaikavian over Shtokavian was that Zagreb, the capital of Croatia, spoke that dialect.
The reason Shtokavian was chosen and not Kaikavian was because there Shtokavian dialect was the most common one and the Bosnian Croats also spoke that language, meanwhile the Slovenes were regarded as Croats or at least a brotherly nation by several circles, but that thought was never pursued as a state policy, the most serious attempt at unifying Croatia and Slovenia I can find, is Ante Starčević’s letter to Slovenian writer Lipe Haderlap where he shares his thoughts on such a matter.
Ante Starčević’s opinion on the situation were that an independent Slovenian nation couldn’t exist under the presence of the Italian and German states and that it would eventually fall victim to their influences, which is why they should unite with their bigger Slavic brother nation to the south and stand a better chance, sounds remarkably like Yugoslavia, except it was the Croatian version, an attempt at restoring Illyria, which would also include the states of Croatia, Bosnia and Herzegovina, Vojvodina and Montenegro.
But haha, I just noticed, your question said “why don’t Croatia and Slovenia unite” rather than “why didn’t they unite”, there is even less of chance of Croatia and Slovenia uniting now due to how much we yearned for full independence, how we have developed as different people and the general political disdain between our governments.