The government's system for granting security clearances is an outmoded bureacratic shambles that clears too many people carelessly and keeps those who need clearances waiting too long, according to testimony yesterday before a Senate subcommittee.

More than 4 million Americans hold government security clearances, including more than 53 percent of government employes, most of them in defense-related jobs. They represent, Sen. Sam Nunn (D-Ga.) said, "unfortunately, an increasingly massive" target for Soviet spy recruiters.

Yesterday's hearing, the first in a three-day series, focused on the problem of conducting background checks on immigrant aliens. For example, the Pentagon has granted or is processing security clearances for nearly 11,000 employes of defense contractors who are emigres from the Soviet Union or other Communist bloc countries and whose backgrounds could not be investigated, according to documents obtained by the Senate Government Affairs permanent subcommittee on investigations.

The procedural problems can extend to NATO allies as well, the investigation indicated. Among the ranks of cleared immigrant aliens is P. Takis Veliotis, the Greek-born former executive of General Dynamics Corp. He is a fugitive from charges of participating in a $2.7 million kickback scheme while supervising a shipyard that worked on military and nuclear propulsion programs.

In a 43-page case study, committee investigator Fred Asselin detailed how Veliotis was given a security clearance despite the Navy's concerns about his foreign background and conflicting information about his education and a conviction on a money order violation in Greece. Veliotis kept his clearance even after the kickback investigation focused on him.

A U.S. double agent, an Army sergeant testifying behind a screen to conceal his identity, also told the panel how he was recruited as a Soviet spy at a bar in Bangkok and was paid $25,000 over 10 years to deliver secrets to Soviet officials on four continents. If he had been a traitor to the United States, he said, "I don't think I would have been caught unless I made a mistake."

Since 1979, documents show, the number of defense industry employes who have received clearance has increased by more than 44 percent, to 1.5 million, said Nunn, the subcommittee's ranking Democrat.

At the same time, severe personnel shortages are hampering the Defense Investigative Service (DIS), which performs background investigations, as do the Office of Personnel Management and the FBI.

Nunn cited Defense Department figures showing that the DIS now gets as many as 26,000 contractor requests for clearances a month and that it would take it a decade to complete the 280,000 clearance reinvestigations required for contractors as of 1984. Personnel are supposed to be reinvestigated every five years, but many officials have not been checked in the past 20 years, according to the subcommittee's staff.

In fiscal 1982, the General Accounting Office said, the delays cost approximately $850 million in productivity, as government and contractor employes were forced to wait for their clearances before they could work. The delays subsequently were reduced, the GAO said, but now are rising again.

Sen. Albert Gore Jr. (D-Tenn.) charged that the Reagan administration was guilty of "apparent foot-dragging and bureaucratic wrangling" on the problem instead of taking steps to correct it. In addition to the familiar "cartoon image of the mindless bureacrat stamping documents 'secret' on an assembly-line basis," he said, "what we're seeing here is evidence that other bureaucrats are using another assembly line to give out secret security clearances."

The administration has designated national security a top priority, seeking, among other things, to expand the use of polygraph tests for government workers.

Gore and Nunn said they are looking toward legislation, possibly this year, that will supplant the two- to three-decade-old hodgepodge of executive orders by which government and contractor personnel security clearances are now governed.

The Senate investigation stemmed from recent cases in which some of America's most guarded high-technology secrets were sold to enemy intelligence services by people with security clearances, Nunn said.