CASPAR WEINBERGER, stepping down after seven years as secretary of defense, got a rousing send-off from his chief yesterday, and it's easy to understand why. In Mr. Weinberger, the president had a fiercely loyal lieutenant committed to achieving his first security goal of a defense buildup. The losers in the budget battle are complaining and will be doing so for years; the services, short on self-discipline, were indulged by the secretary and will probably be groaning for years as or if discipline comes to be applied. And there remain some very large questions about whether the vast investment was wisely made or whether, as some reputable defense scholars claim, it was carelessly made and in some sense squandered, whether the country will be truly more secure as a result. There are also defense-minded legislators on the Hill who claim that Mr. Weinberger's extreme and unbending insistence on huge budget increases ended up undermining the effort to get congressional cooperation on necessary projects.

But Mr. Weinberger's relentless pursuit of greater military capability and readiness did build the position from which the president is now conducting a diplomatic program with the Kremlin of unprecedented comprehensiveness. He was also, politically, generally on the side of restraint in the actual application of force in local situations. In the Iran-contra maze, Mr. Weinberger did not lose his way.

He bequeaths Defense to his former No. 2, the thoroughly prepared Frank Carlucci, currently President Reagan's national security adviser. The hard right suspects Mr. Carlucci of terminal closet pragmatism and sees him leaping into conspiracy with the favorite figure of conservative demonology, George Shultz. The nugget of truth in this nonsense is the perception that the proper burden of the secretary of defense has in fact shifted. In the year remaining to him, Mr. Reagan needs advisers who can help him use wisely, in negotiations and in operational situations such as the Gulf, the power amassed in his first seven years. Mr. Carlucci knows the territory, political and international.

Lt. Gen. Colin L. Powell, the deputy national security adviser, moves up a notch. He is a relative newcomer to policy councils who is strong on process, a general who in a short time has earned high regard in political circles. It will be interesting to see whether his appointment revives the talk, current when Robert McFarlane and John Poindexter got in trouble, that a military man shouldn't hold the job. The view always seemed too categorical to us.