It is important but perhaps nor primary cause
The primary and overwhelming cause for the Yugoslav wars in the 1990s was a national question. Religion does have large impact on national identity in the former Yugoslavia, but things are not that simple. Let's go step by step:
Albanians are not a Slavic ethnic group, they do not share the same language, culture or even biological(genetic) background as other Yugoslav nations mentioned here. There are basically two schools about the origin of the Albanians, one ties them to autochthonous Illyrian population, predating the arrival of Slavs to the Balkans. The other links them with Caucasus ethnic groups (Chechens, Tatars, Cherkess ...) settled by Ottomans during their occupation (and expulsion of Slavs, especially Serbs) . Most likely both theories had some grain of truth. Albanians are mostly Muslim, with a significant minority of Catholics, but Catholics were once dominant. Therefore, it is likely that Albanians originating from Illyrian ancestry did try and resisted Islamization, while converts and newcomers became Muslim. Anyway, religion didn't play large part in the conflict between Serbs and Albanians, as mentioned these were and are completely different ethnic groups.
Bosnian Muslims originated from the Slavic population of the region intermixed with some other ethnic groups that arrived in Bosnia during the Ottoman occupation (Turks, Albanians, Arabs, people from Caucasus etc). It is fairly certain they were either Orthodox or Catholic before their conversion to Islam (Bogumilism already disappeared by that time). Religion indeed plays a big part in their formation as an independent ethnic group, especially since they considered themselves to be "Turks" right until the early 20th century. The name "Bosniak" is a neologism created during 1990s to define them as a separate ethnicity, and not as a religious group. Overall, it could be said that religion plays its largest part in their conflict vs Serbs and Croats, but mostly because historically it gave them different hierarchical status in the Ottoman empire (semi-ruling class, especially compared to Christians). This of course created separation and resentment.
Croats are an old ethnicity and probably came as such (separate tribe(s)) during the Slavic settlement on the Balkans. They did have their kingdom during the early Middle Ages, and were Catholic, but enventually lost independence in 1097. Their nobility was Hungarianized and then Germanized, as was the clergy and the other upper echelons of society. Animosity towards Serbs came only latter, during the rule of Austria-Hungary and it was carefully crafted as part of Austrian divide et impera to keep the Slavs at each others throats, therefore preventing them from uniting against rule from Vienna/Budapest. The Catholic church did have part in this, in a sense that it did become an integral part of Croat national identity. Effectively, Serbs and Croats in bordering communities differentiate between themselves only by their traditional religion (although they might not be believers themselves).
Finally, Serbs are also an old ethnic group, most likely predating conversion to Christianity and arrived as such in the Balkans. Although today the Serbs identify as being Orthodox, the first Serbian ruler crowned as king received the crown from the Pope. However, subsequent Serbian medieval state and monarchs tied themselves firmly to Orthodoxy, which became part of the national identity. Nevertheless, Serbian monarchs did occasionally intermarry with Catholics (most prominent example is Helen of Anjou) and there are no examples of purely religious Orthodox vs Catholics wars in which they participated (there were clashes vs Catholic Hungarians, but also against Orthodox Greeks and Bulgarians). During the Ottoman occupation, Orthodox clergy did keep the national spirit alive and were often supporters of various uprisings.
As we can see from all of that, importance of religion as a cause for conflict varies. In the Albanian case it is almost non-existent. In the case of Bosnian Muslims, it is indeed primary cause, because Islam truly separated them from their Slavic brethren. In the case of Serbs and Croats it is more complex and difficult. These nations certainly did exist for a long time, but perhaps their conflict would be less pronounced without religious differences (Czech and Slovaks come to mind).