Congressional demands to have the Air Force and Navy seal U.S. borders against illegal drug shipments have been turned aside by the Pentagon and legislators who say the Defense Department already has enough to do.

"I think we changed a lot of minds with our hearings," said Sen. Sam Nunn, D-Ga., chairman of the Armed Services Committee, as he detailed a Pentagon budget bill approved Thursday by congressional negotiators.Nunn was the prime mover behind a series of committee hearings last month at which Pentagon officials said giving them increased anti-drug responsibilities would hurt the military's main mission of being ready to defend the nation against enemies.

The House had earlier voted to order President Reagan to have the Pentagon essentially seal U.S. borders against drug traffickers within 45 days. The Senate approved arrest powers for Navy officers aboard warships which stop drug boats on the high seas.

Both proposals were dropped in the final version of the bill.

The final measure does order the Pentagon to improve and expand its role in providing anti-drug intelligence to civilian law enforcement agencies, including more extensive tracking of ships and planes.

The $300 billion bill also sharply reduces Reagan's Star Wars anti-missile plan.