SHORT ANSWER
The Ottomans used camels because they have several advantages over horses. Among other things, they can carry more than horses and adapt well to a variety of climates (even cold ones) and terrain, and were thus ideal for transporting the large quantities of supplies needed by the Ottoman armies.
DETAILED ANSWER
Camels were used in large numbers by the Ottomans for a number of very good reasons. The setbacks of 1529 and 1683 at Vienna were primarily due to insufficient firepower in order to breach the walls of Vienna, not to the use of camels. In this regard, the campaign of 1683 did indeed repeat the mistake of 1529.
One hundred and fifty-four years had passed since the first siege of
Vienna in 1529. The Turks had possessed no heavy guns then and it is
strange to note that they also had none in 1683.
Source: Stephen Turnbull, 'The Ottoman Empire 1326-1699'
The campaign of 1529 was also hampered by unusually wet weather which meant most of the heavy artillery was left behind. While the camels would have preferred a warmer, drier climate
they do well in temperature ranges from 20 degrees F (minus 29 degrees
C) to 120 degrees F (49 degrees C).
Source: https://www.livescience.com/27503-camels.html
Reports on the US Army’s experiment with a Camel Corps before the Civil War provides further evidence of the advantages of using camels in different environments. U.S. Army LT George H. Crosman noted that
Their feet are alike well suited for traversing grassy or sandy
plains, or rough, rocky hills and paths, and they require no shoeing…
Camels, as noted by Donald Quataert in The Ottoman Empire 1700 - 1922, were primarily used by the Ottomans for transport.
...horses dominated the Balkan transport routes while camels tended to
prevail in the Arab and Anatolian lands. To this general rule, there
were exceptions. Ottoman armies had used massive numbers of camels to
transport goods up the Danubian basin
While horses are faster over short distances, camels are hardier, have greater endurance and can carry much heavier loads. Quataert continues thus:
Superior to all other beasts of burden, the camel could carry a
quarter-ton of goods for at least 25 kilometers daily, 20 percent more
weight than horses and mules and three times more than donkeys. Mules,
donkeys, and horses, however, often were preferred for shorter
trips.... because of their greater speed.
There is some dispute as to how much more weight than a horse camels could carry as Halil Inalcik, in ‘An Economic and Social History of the Ottoman Empire, Volume 1’ says that they had double the capacity. Perhaps the difference has to do with the size of the animal, but there is no doubt that camels could carry more, also when compared to mules, as the US Army Camel Corps discovered in 1856:
The mule drawn wagons, each carrying 1,800 pounds of oats, took nearly
five days to make the return trip to camp. The six camels carried
3,648 pounds of oats and made the trip in two days, clearly
demonstrating both their carrying ability and their speed. Several
other tests served to confirm the transporting abilities of the camels
and their superiority over horses and mules.
Getting back to the Ottomans, Inalcik, referring to why camels were so valuable to the Ottoman army, states that:
The camel was used in the transport of all kinds of heavy equipment,
such as arms and ammunition and provisions for the army... The
Ottoman army was able to move from the Euphrates to the Danube in one
season with all of its heavy equipment and arms. Without the camel,
transport costs would have been prohibitive for carrying wheat, flour
and barley for provisioning the army...
Although the Ottomans primarily used camels for transport, they could also be effective against horse cavalry as they are more intelligent than horses and less inclined to panic in difficult situations. Also, horses don’t like the unfamiliar smell of camels and spook easily
If a horse isn't familiar with something, it's much more likely to spook than a camel.
However, despite the discovery in Vienna of the remains of a camel which was clearly used for purposes other than transport, the Ottomans do not appear to have used many (or even any) of these beasts for fighting on the campaigns in Austria. All of the sources I have consulted on the Ottoman army only mention camels as beasts of burden. The Ottoman cavalry was comprised mostly (maybe even exclusively) of horses, not camels, and one camel 'find' cannot be interpreted as evidence of a unit of camel cavalry – maybe this camel was simply ridden by someone in the Ottomans' multi-national army (which included Arabs) who was more used to camels than horses.
Finally, it should be pointed out that the Ottomans didn’t just lose lots of camels in 1529. They also lost much of their artillery, many janissaries and thousands of infantrymen (but no one would suggest not taking any of these). The light infantry seemed to have fared best but, as the Wikipedia entry points out, they weren’t much in a siege.
(all highlighting is mine, not the sources')
Additional sources:
D. Nicolle & A. McBride, ‘Armies of the Ottoman Turks, 1300 – 1774’
Daniel Goffman, ‘The Ottoman Empire and Early Modern Europe’
http://www.theottomans.org/english/campaigns_army/index.asp
https://en.wikipedia.org/wiki/Akinji
https://en.wikipedia.org/wiki/Sipahi
https://en.wikipedia.org/wiki/Ottoman_Army_(15th-19th_centuries)