PRESIDENT Reagan, whose spontaneity is one of his most likable qualities, spoke carelessly a few times on his Latin trip and paid for it in the media coverage. For the most part, however, he acted quite carefully, and the United States' interests in Latin America should profit as a result.

This was more than a good-will trip. Broadly speaking, everyone was looking to see whether Mr. Reagan would define Latin America's problems narrowly in terms of the threat posed by foreign- backed Marxist guerrillas or would widen the American focus to cover the dangers to stability posed by internal tensions and the hemisphere's economic agenda as well.

The president did not ignore the guerrillas, who are, after all, real. It was in a surge of anti-guerrilla enthusiasm that he indicated -- unwisely and, it turned out, prematurely -- that the United States regarded El Salvador and Guatemala as already fit from a human rights standpoint for more aid and new aid, respectively. But he held his tongue in Brazil and Colombia, countries that fear that a fascination with externally sponsored guerrillas diverts attention from home-grown ills.

The president's calculated discretion cost him the opportunity to engage the two countries in the sort of extended political dialogue that they, and especially Brazil, would find pleasing and appropriate. Instead, Mr. Reagan listened hard to the disagreeable things the Brazilians and, especially, the Colombians had to say about the world. In the circumstances, that was not a bad thing to do.

The president made a major effort to raise bilateral relations with Brazil, the sprawling giant of Latin America, to a level commensurate with its stature and size. He did this by going there, by showing American confidence in Brazil's economic management and political leadership in tangible ways, including a $1.2 billion, 90-day credit, and by undertaking to expand economic cooperation. The Brazilians wish it to be known they are too powerful and too proud to be "bought." But surely they recognize that the advantages for them of American favor, in terms of their stability, are no less than the advantages for the United States.

At other points on his itinerary, Mr. Reagan was similarly attentive to the economic considerations that, more than any guerrillas, will determine the Latin destiny. This evidence that the president has accepted the recommendation of his secretary of state to adjust the emphasis of American policy was the best result of the trip.