Didn't the Ottomans fight a series of wars against the Habsburgs for over a hundred years?
This question spans a long period of time during which Spain, the Andalus regime, and Ottoman, and many other Mediterranean factions (and beyond) evolved quite a bit.
In 1400 we have the Emirate of Granada as the sole survivor of the Andalusian muslim kingdom, with the Christian states in Iberia having made significant progress in their unification: the major powers are Castile&Leon, Portugal, and Aragon.
All the way across the Mediterranean, the Ottomans were focused mainly in expansion into the Balkans. Then, the arrival of Timur's horde led to the capture and death of Bayezid, bringing an era of civil war and weakness. The next several rulers were busy consolidating Ottoman rule and strengthening their influence in the Balkans. It was not until Mehmed II that they were strong enough to take Constantinople in 1453.
So, why didn't the Ottoman help the Andalusians in this era? They were busy with their own threats.
From this point on, we have a rising Ottoman power coming increasingly into conflict against the Habsburg, which also ended up controlling Spain. So, did they directly help the Andalusians? By this point the Reconquesta had been completed, although it took several hundred more years of expulsion and conversion and inquisition before Iberia becomes nearly fully Christian.
If the Ottomans wanted to directly help the Andalusians by sending soldiers there, they'd have to go through the Mediterranean, which was patrolled by the Spanish, the Genoese, the French, the Venetians, and other states including the Papal States. You can read up on the Barbary pirate states such as Salé, Algiers, Tunis, and Tripoli, which are under varying degrees of suzerainty to the Ottomans. These pirate states ran raids on coastal towns to seize booty and persons to sell as slaves.
This era also saw alliance between Francis I of France and Suleiman. Famously, an Ottoman fleet spent some time in French ports by the end of 1536, to threaten both Genoa and Spain.
The Ottomans certainly had some interest in threatening Spain directly, including sending agents to try and stir up rebellions by the Moriscos and Muslims still living in Spain. Although they were not successful in fomenting a major uprising, these attempts further frayed the discord between Christians and Muslims in Spain, resulting in further expulsion and weakening of the local economy.
So, why didn't the Ottoman help the Andalusians in this era? The was no longer an Andalusian Muslim state, and the reach of the Ottomans were limited to indirect help as it suited their strategic interests.
Of course, things come to a head in the famous Battle of Lepanto, which saw a Christian coalition beat back an Ottoman fleet. Following this battle, the Ottoman fleet was mostly contained in their own friendly waters, both due to loss of officers and the rising threat of Persia.
But the Barbary pirates continued their ways, even without explicit Ottoman help. This era saw further consolidation, with Muslim powers re-gaining lost outposts in North Africa and Christians further securing the Balearic islands, Italy, and the Adriatic.
At the same time, Spain switched its focus to the Atlantic, but this is going beyond the scope of this question.
What is important to realize is that galley operations rely on extensive logistics. It needs bases to keep the men (and slaves) supplied to some extent. Thus, the consolidation of areas of influence did a lot to discourage massive attacks against one another.
So, why didn't the Ottoman help the Andalusians in this era? The was no longer an Andalusian Muslim state, there were even fewer Muslims in Iberia, there was significant consolidation across the Mediterranean, and there were larger threats elsewhere.
References: