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 Spanish and Portuguese empire were that the force of Portugal was in the navy while the Spanish was on the army. Spain hadnt a good navy until he was taking into account about the power of Portugal.
The problem of portuguese army was seen when Portugal decided to invade Afrika after the prosperous conquest of America by Spain.
At the moment of the war lead by Spain to face Ottoman empire, the Portugal´s prince decided to invade north Afrika. All to expand its empire in Afrika. The Portuguese Prince decided to do the operation even personally. It was the biggest military operation ever made by Portugal.
The portuguese army concentrate the best of his troops in total 17.400 troops. That was a big army but not enough to the operation (in spite of military advisers saying him that was needed unless 125.000 troops to have a success in the adventure he was stubborn), however, the portuguese navy decided to make a last stop in Spanish port of Cadiz.
The news of the portuguese prince operation arrived even to Philip II. The spanish king even told him not to do such a madness. However, the spanish king couldnt convince the portuguese prince but as his uncle decided to reinforce his army with 5.600 troops of Spanish, Italians, Germany and Belgian´s troops in order to not leave alone.
The madness of prince was made but his operation ended in a total disaster, because he faced a 100.000 moorish army in the hot climate dessert of marocco. Later, they never decided to be far away from the safe coast. Since then, nor Spain nor Portuguse try to face moors in north afrika in XVI.century.
The only success operation of Spain to control marocco was by the first industrial army in 20s. 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?