When President Reagan heard recommendations of his top advisers yesterday on whether to continue respecting the SALT II treaty, he faced an ironic difference of opinion between his civilian secretary of defense and his uniformed military aides.

The secretary recommended that the United States cease observing an arms control agreement he considers useless to American security, but the admiral and generals of the Joint Chiefs of Staff declined to endorse that suggestion.

Instead, the chiefs said the decision on sticking by SALT II after the unratified treaty expires at the end of this year is a "political" one that Reagan will have to make. They warned that it would be risky to retire a Poseidon submarine and its 14 missiles later this year, as SALT II would require, but also noted the benefits of continued adherence to the arms pact's limits on both superpowers' nuclear arsenals.

The chiefs' presentation at the National Security Council meeting "was an analytical one," according to an administration official. "They reviewed where we are and where we would be in our strategic modernization program compared to the Soviets under various situations."

Gen. John W. Vessey Jr., chairman of the Joint Chiefs, emphasized that Congress may restrict the deployment of the new MX land missile so severely, officials said, that it might not be wise to retire the older Poseidon submarines as more new Trident missile subs go to sea.

Vessey's linkage of MX and Poseidon sounded to some officials like a step away from the chiefs' formerly solid support of SALT II and toward the position of Defense Secretary Caspar W. Weinberger.

But the chiefs would not join Weinberger in flatly recommending abandonment of the SALT II treaty. Usually it is the civilian leaders urging the generals and admirals to support an arms control treaty, as was the case during the birth of both SALT I and II.

In the past, Vessey and the other chiefs have said that anything that limits the number of warheads targeted on the United States eases their problem of protecting the nation. From a military point of view, the potential nuclear threat to the United States depends on the number of warheads the Soviets can target against this nation's weapons and cities. The Joint Chiefs have traditionally argued that arms control agreements that hold down the number of Soviet warheads tend to stabilize the balance of terror, and hence are useful.

Both superpowers have relied on more than arms control agreements to protect their strategic forces. The United States and Soviet Union first fortified their land missiles by placing them underground and later sent other missiles to sea in submarines to decrease their vulnerability. Now the United States and Soviet Union are trying to make their land-based strategic missiles mobile to foil attack.

The Air Force is developing a small, mobile land missile called Midgetman which would be hauled around military bases to make it hard to target or hit. But the Midgetman could eventually prove vulnerable, too, if the Soviet Union deploys enough warheads to barrage the limited number of military bases where they could be located.

Without negotiated limits, some military analysts warn, the Soviets could deploy so many warheads that the only survivable long-range mobile missiles would belong to the Navy and its submarine fleet. Many Air Force leaders see the limits in SALT II as the best way to keep their land missiles from becoming obsolete. The Air Force could lose much of its strategic role if even mobile missiles became unacceptably vulnerable.

Navy and Army leaders also see military advantages to sticking with SALT II limits. With an unlimited number of warheads, the Soviets might be able to spray the areas of the oceans where U.S. submarines are known to hide. The Army, which has a big role in the nation's missile defense