While the Spanish built a huge colonial empire in the Americas, why didn't Portugal colonize the South Asian coast and only aimed at controlling trade?
Why did these empires pursue such different strategies?
After the voyages of Columbus, who sailed for Spain, the Portuguese and Spanish divided up the new world in the Treaty of Tordesillas (1494). The later pattern of colonization followed this treaty in general outline.
Your question has an incorrect assumption, that the Portuguese were only traders. They had a global empire that included Brazil, islands in the Caribbean, the Azores, many places in Africa, India and Southeast Asia.
Spain and Portugal controlled their colonies differently because they developed differently during the 15th century.
By the 15th century, Portugal was already a "complete" country. The century was characterized by seagoing voyages under Prince Henry the Navigator, around the coast of Africa. The end result was Vasco da Gama's sailing totally around Africa, all the way to India. It was too hard for the Portuguese to "project power" over such a long distance, and further, to modern Indonesia, so they preferred to operate by "proxy," via trading posts.
Spain spent the 15th century driving out the Moors from Granada, subjugating it in an overland attack. After they finished, in 1492, Columbus discovered a large, and sparsely populated continent far to the west. But apart from the "small" matter of a few months of sailing, conquering the (American) "Indians" was a task well-suited to men who have just finished conquering the Moors, which is why the Spanish used such a "top down" approach to governing their empire.
I think the difference between the Spanish and the Portuguese empires was that Portugal's strength was its navy while Spain's strength was its army. Spain did not have a good navy compared to Portugal's.
The problem of the Portuguese army was seen when Portugal decided to invade Africa after the prosperous conquest of America by Spain.
At the moment of the war led by Spain against the Ottoman Empire, the Portuguese King decided to invade North Africa. All to expand its empire in Africa. The Portuguese King decided to do the operation even personally. It was the biggest military operation ever made by Portugal.
The Portuguese Army concentrated the best of its troops, in total 17.400 troops. That was a big army but not enough to the operation. Although military advisers told him that 125.000 troops were needed to be successful in the adventure, the King was stubborn. However, the Portuguese Navy decided to make a last stop in the Spanish port of Cadiz.
The news of the Portuguese King's operation arrived even to Philip II. The Spanish King even told him not to do such madness. However, the Spanish King couldnt convince the Portuguese King but, as his uncle, decided to reinforce his army with 5.600 troops of Spanish, Italian, German and Belgian troops in order to not leave alone.
The madness of the King was made but his operation ended in a total disaster, because he faced a 100,000-strong Moorish army in the hot climate dessert of Morocco. Later, they never decided to be far away from the safe coast. Since then, neither the Spanish nor the Portuguese tried to face Moors in North Afrika in the XVI century.
The only successful Spanish operation to control Morocco was by the first industrial army in 1920s. Spain needed to use 140.000 soldiers, 30 tanks, 160 fighter-bombers, the 80% of the whole navy and with the support of France.
I don't think there was a huge difference between Spanish and Portuguese methods of colonisation. There was a bigger difference between the places Spain took as colonies and the places Portugal took as colonies.
First of all, the penetration of European power in the Americas was much easier than in Africa or Asia. Many Asian states were powerful entities, which could not easily be defeated in the battlefield - and even if they were, the population under them was enormous, making it very difficult for a foreign power to establish a permanent and stable occupation. China was never occupied; India was only reduced to a true colony in the 19th century; the same is true of Indochina. And Africa had a very powerful epidemiological barrier that prevented European occupation; the Europeans were only able to penetrate the continent once farmacological advances made it possible to prevent and cure several diseases that would previously make it impossible.
So European "empires" in Asia or Africa would have necessarily been mostly control of key ports and river mouths, allowing monopolies of foreign trade. This only changed in a time when both Portugal and Spain were in clear retreat, systematically losing power and status at international politics. Naturally, the French and the British built territorially massive empires in the 19th century; at that time, Portugal and Spain mostly fought in the defensive, trying no to lose their older empires. (The main exception, here, goes exactly in opposite direction to that implied in your question: the Portuguese were still able to further penetrate Angola and Mozambique, which up to then were mostly coastal enterprises, and establish considerable territorial entities there.
The Americas, in the other hand, were an epidemiological paradise; with the possible exception of syphillis, no important diseases threatened the European invaders, and those, on the contrary, brought with them pathogens unknown in the Americas, that heavily decimated the local populations. The aboriginal population was also much more sparse, and the technological difference between the Europeans and the locals was much bigger than in the case of Asia, and even Africa. So several European powers were able to establish territorially vast empires.
But there is certainly a difference between the areas in the Americas that were occupied by the Spaniards and those occupied by the Portuguese. The former quickly found silver and gold (in no minor part because those metals were already mined by the Aztecs, Mayans and "Incas"), metals that weren't generally in the shores, but in the mountains of Mexico and Peru, and consequently headed to the hinterland very soon, in the measure that they could depopulate the land and disorganise and defeat the local states. The Portuguese only found gold in the end of the 17th century, and had to rely in either extractivism (from which Brazil derives its very name) or agriculture, so they had to expend much more effort in securing their empire until the Iberian Union granted a truce with Spanish expansion and allowed the huge movements towards the interior ("bandeiras") that finally found gold and diamonds in the Geraes and propped the occupation of the Central Highlands and the Amazonian basin.
So the picture you draw in your question is quite incomplete; but the Portuguese did not build a territorial empire in Asia/Africa similar to the Spanish empire in the Americas because they couldn't; they initially didn't build a similar empire in Brazil because there was no clear immediate hint that they would find precious metals and gems in the hinterland. When the Portuguese could and found necessary, they built huge territorial colonies both in the Americas (Brazil) and Africa (Angola and Mozambique).
If you add to that the fact that the population of Portugal was considerably smaller than that of Spain (something between 1:4 and 1:7), the question is possibly the opposite: how did the Portuguese manage to expand their overseas possession so much, upon such a fragile metropolitan position?