In particular I think about Spain and Portugal, who pioneered colonization and were superpowers in the 16th and 17th century but were in a less dominant position afterwards. How come the Ottomans get all the attention for this perceived weakness when other Great Powers of Europe have lost their almighty position much earlier
I think the reason it was not as acutely applied in the sense it was to the European powers as it was to the Ottoman Empire is because the "Sick man of Europe" was less a descriptor of the Ottoman Empire and more a rationalization to justify European interventions in portions of the Ottoman Empire or the Empire as a whole in a humanitarian light.
The Ottoman Empire throughout the 19th century experienced turmoil on a level many European states did not need to encounter as the myriad of constituent bodies across the Empire be it military, civil, religious, economic or ethnic began to clash on a scale that was difficult for Imperial authorities to control and that following Napoleon's invasion of Egypt, European powers felt as if they could successfully become stakeholders on behalf of certain groups in the Empire and intervene in Ottoman affairs. One such example where the European Powers tried mediating above the Ottoman Empire was the Oriental Crisis of 1840.
Muhammad Ali, the now renegade Wāli of Egypt declared Egypt and provinces under his administrative control his Khedive. This resulted in regions of the Ottoman Empire like Sudan, large portions of Syria and Palestine as well as Egypt breaking off from the effective control of the Porte. Ottoman authorities attempted to reinstall themselves in Egypt through a military conflict. This resulted in a catastrophic defeat for the Ottoman Army in the Battle of Nezib which was the closest point in centuries to the Ottoman Empire approaching a total and definitive collapse. So great was the defeat was the Ottoman Navy sailed to Alexandria and surrendered to Muhammad Ali in anticipation of a total defeat. The death of ruling Sultan Mahmud II and the ascension of the 16 year old Abdülmecid further complicated the situation for the Turks. The Ottoman authorities had been dealt a colossal blow and without the intervention of the European Powers the Ottoman Government perhaps would've been radically reformed in the face of such a defeat or collapsed in on itself. Egypt was given the written support of France and many suspected French intervention potentially if people stepped in to the aid of the Porte. Such an occurrence did not materialize however.
The powers of the United Kingdom, Austria, Prussia and Russia diplomatically intervened in announcing their support for the Ottoman Empire and then acted militarily by cutting off the Egyptian armies communications with Cairo through a blockade from an Anglo/Austrian detachment of ships from the Nile to the Levant. And thereafter conducted landings to capture the cities of Beirut and Acre from Egyptian forces. This timely intervention by the British and Austrians resulted in fortunes turning against Muhammad Ali's position, and he soon accepted the European mediation that would return to the Ottoman Empire the territories of Crete, the Levant and the Hijaz and most importantly return the surrendered Ottoman fleet and reduce the size of his armed forces. The Europeans also allowed Muhammad Ali and his dynasty to remain rulers of Egypt and the Sudan on a hereditary basis which the Ottoman Sultan was in no position to refuse. Shortly after Ali's agreement the Sultan issued a decree recognizing the European promises as a legally binding appointment of Ali and his heirs as the Viceroys of Egypt.
This was a victory in the sense the de jure control of the Ottoman Empire was restored over Egypt and the High Porte commanded their Arab territories and Crete again. But this opened for the Europeans the doors to mediate in Ottoman affairs when they pleased. And time after time the European meddling would be to the inevitable detriment of the Ottoman Empire.
The inability to effect their rule in many nominal aspects of the Empire resulted in some European figures beginning to hungrily eye Ottoman territory. Chief among those figures was Tsar Nicholas I of Russia whose Empire having begun more firmly securing his Caucasian holdings now saw the lands of the Ottoman Empire as potentially rich additions to his Empire and Russian policies throughout the 19th century began increasingly projecting influence to force the Ottoman Empire into Russia's exclusive sphere of influence.
Russia was a historical enemy of the Ottoman Empire and had a multitude of conflicts with the Turks, initially the Turkish Empire held the military advantage and in centuries past projected their influence throughout the caucuses and Steppes, with Turkish authority being recognized, respected or endorsed by powers throughout the Caucuses and as far north as the mouth of the Don. The nature of these conflicts however slowly turned into Russia's favor as Russia expanded it's military and political power; and finally the paradigm shifted irreversibly to the point where Russia held supremacy over the Turks in military affairs overwhelmingly following Russia's victory under Catherine the Great in the Russo-Turkish War from 1768-1774. These defeats pushed Turkish influence out of what is today's Ukraine and Northern Caucuses and left Russia in an enviable position to pursue further war against the Turks should they choose.
The most important concession for the Russians was they were by treaty the protector of Orthodox Christians in the Ottoman Empire. An authority that would result in the Crimean War inevitably. The victory over the Ottomans opened the "Eastern Question" which preoccupied diplomatic authorities across Europe. As many recognized during this period of weakness dividing the Ottoman Empire in the near future might be a reality. No such divisions occurred in the 18th century and the Ottoman Empire slowly rebuilt it's strength. But the failures to recapture their territories lost in the previous Russo Turkish war in their pursuit of a second war from 1787-1792 ensured the Ottoman positional weakness was the new status quo.
The reason the sick man of Europe was so constantly talked about in regards to the Ottoman Empire when other powers declined more abruptly and immediately like Spain or Portugal is the Sick Man of Europe was a term initially coined to recognize the unique imbalance of Ottoman-European diplomatic and military affairs. It was a term coined in the press and circles of power across Europe to justify the manifold interventions countries would undertake to the support or detriment of the Ottoman Empire. It recognized the growing asymmetrical relationship of European authority in concern to the Ottoman Empire and at times was an excuse to intervene on behalf of groups like Maronite Christians for France and Orthodox Christians for Russia. In a similar vein it was also used to uphold Ottoman authority in instances where it was threatened with collapse like the Oriental Crisis of 1840 or the Crimean War. Nicholas I was attributed with a quote that perfectly reflects the duality of weakening but preserving the Ottoman Empire with their recognition as a "sick man":
We have a sick man on our hands, a man gravely ill, it will be a great misfortune if one of these days he slips through our hands, especially before the necessary arrangements are made.
The Ottoman Empire throughout the 19th century can be best described as being treated as if they're on life support. This is a evaluation of the Ottoman Empire's true condition but it does reflect the increasing patronizing that encompassed Western relations with the Empire up until it's dissolution following the First World War.
Sources:
Harold Temperley, England and the Near East (London: Longmans, Greens and Co., 1936), p. 272. Temperley's translation of the Emperor's comment [spoken in French] is quite accurate. An alternative translation from the original published document follows: "We have on our hands a sick man -- a very sick man: it will be, I tell you frankly, a great misfortune if, one of these days, he should slip away from us, especially before all necessary arrangements were made." Source: Parliamentary Papers. Accounts and Papers: Thirty-Six Volumes: Eastern Papers, V. Session 31 January – 12 August 1854, Vol. LXXI (London: Harrison and Son, 1854), doc. 1, p. 2.
Efraim Karsh, Inari Karsh, Empires of the Sand: The Struggle for Mastery in the Middle East, 1789-1923, (Harvard University Press, 2001), 36-37.
A.J.P. Taylor, The Struggle for Mastery in Europe: 1848–1918 (1954) pp 228–54
Michael S. Anderson, The Eastern Question, 1774–1923: A Study in International Relations (1966) ch 1