The White House said yesterday that it will try to weaken economic sanctions voted against South Africa by the House and the Senate, but officials stopped short of threatening a veto.

Spokesman Larry Speakes said sanctions "are the wrong way to bring about changes we all desire to see" in South Africa's policy of apartheid, or racial segregation. Many sanctions are "harmful to blacks in South Africa and have punished U.S. companies," he said.

"These sanctions will not increase U.S. influence on the pace and direction of change in South Africa and will reinforce those elements that are most opposed to change," he added.

Speakes said the administration welcomes parts of the Senate bill that commend U.S. companies for supporting antiapartheid measures, but said it would "seek some improvements" next week when the two versions come before a House-Senate conference committee to resolve differences.

The Senate voted Thursday to ban new U.S. bank loans and nuclear technology to South Africa, curb computer sales and tighten the sanctions further if no progress is made on ending apartheid within 18 months. The House measure imposes stiffer sanctions immediately: a ban on importation of South African krugerrand gold coins and a halt to private U.S. investment there.

Backers said the votes were mostly symbolic but long overdue evidence that Congress, responding to increased pressure from the American people, is placing the United States on the side of the black South African majority.

The votes were a sharp rebuff to the administration's policy of "constructive engagement," which stresses low-key encouragement for reform and diplomatic efforts to end fighting on South Africa's borders.

Asked if Reagan would veto the measure, Speakes said the president would have to see the final version before deciding. The Senate vote Thursday was 80 to 12 and the House vote was 295 to 127 -- both more than enough to override a veto if the margins hold.

The South African government echoed the White House's displeasure. "I simply cannot accept that the majority of Americans support this punitive action," Foreign Minister R.F. (Pik) Botha said in response to inquiries.

"We would hope . . . that good sense will prevail" among members of Congress on "the mutually disadvantageous consequences which their actions would bring about," he said.

South Africa's state radio, in a regular commentary that reflects government thinking, said although the bill's economic effect would be negligible, "no hostile action, however mild, that is initiated by the most powerful country in the world can be shrugged off.

"It must cause some degree of cooling of relations and suspicions about motives and economic commitments," Radio South Africa said.

The commentary added that the measure would have no political effect. "Neither South Africa's present policies nor the direction, tempo or manner in which the reform program is being implemented will be influenced," it said.

In a related action, State Department spokesman Robert Smalley said the administration is "particularly astonished" at House action Thursday in voting down military aid to the leftist government of Mozambique.

"We very strongly oppose this action," Smalley said. "It comes at a time of rapidly improving relations with Mozambique, a country which is suffering the effects of violence, drought and economic crisis."

In approving a $12.6 billion foreign-aid bill for fiscal 1986, the House rejected the administration's $3.1 million military-aid request for Mozambique and made $15 million in economic aid conditional on a reduction in the number of that nation's Soviet-bloc military advisers to 55. That is the same limit the administration has imposed on the number of U.S. advisers in El Salvador.

Critics of the request argued that the United States should not be aiding a Marxist government tied to Cuba and the Soviet Union, especially one fighting a domestic rebellion that voices democratic principles. Administration supporters said Mozambique is trying to strengthen its ties to the West, as indicated by its decision to join the International Monetary Fund and the World Bank last year.