The House, ignoring opposition by the Reagan administration, yesterday adopted legislation to reorganize the Joint Chiefs of Staff (JCS), making the chairman, instead of the group, the president's primary military adviser.

The bill, approved 383 to 27 with one representative voting present, was sparked by complaints that interservice rivalries have hampered the Joint Chiefs' effectiveness and weakened the group's advice.

The JCS is composed of the military leaders of each of the four services -- Army, Navy, Air Force and Marines -- and a chairman.

Under current law, the five act together as military adviser to the president, the secretary of defense and the National Security Council.

The bill adopted yesterday would preserve the JCS but expand the chairman's role, making him chief military adviser and giving him control over the JCS staff.

Six recent defense secretaries have come out in support of the legislation or similar reorganization efforts. Defense Secretary Caspar W. Weinberger opposes it, saying the JCS functions well.

Yesterday, supporters of the bill argued that JCS rivalries make the group slow to act, dilute its advice and increase the possibility of wartime inertia.

"It's impossible to fight joint- ly if you don't think jointly, plan jointly and practise jointly ahead of time," said Rep. Ike Skelton (D-Mo.), a sponsor of the legisla- tion.

The current system "fosters parochialism" and "encourages mediocrity," said Rep. William G. Whitehurst (R-Va.).

Opponents of the measure argued that elevating the chairman would undermine the defense secretary's role and the idea of civilian control of the military. They also said it would eliminate competition needed to produce good ideas and could politicize the military.

"I'm a fierce enemy of giving more power to the military," said Rep. Charles E. Bennett (D-Fla.).

The measure goes to the Senate for consideration, where previous House-approved JCS reorganization bills have died.

This year, however, Senate interest is much higher. In October, the Senate Armed Services Committee staff pointed out flaws in the JCS structure and recommended that it be replaced by a military advisory council composed of senior officers from each service, as a last assignment before their retirement.

The committee began hearings on the issue last week, and its leaders have promised to bring a bill to the floor by early next year.