About 2,700 U.S. immigration inspectors received a total of nearly $15 million in overtime pay-on top of their basic pay - in the last fiscal year, according to figures prepared by the payroll staff of the Department of Justice.

A report on the overtime pay is being prepared hurriedly because of a congressional inquiry that revealed last week the Justice Department was paying huge amounts of overtime compared to other agencies surveyed. The Immigration and Naturalization Service is a component of the Justice Department.

Immigration inspectors - the people who, among other things, stamp passports at airports - accounted for most of that overtime because of a 1931 law that gives them what one Justice official called "very preferential" premium pay for working week nights, weekends and holidays.

In fact, the payroll employes at Justice discovered yesterday that, because of a computer error, the figures they had supplied congressional investigators last week on their highest overtime payments were too low.

Their original estimates showed that 458 Justice employes had worked at least 1,000 hours of overtime - or the equivalent of six months' worth of overtime each - during a recent year. Yesterday they said the figure actually is 791 employes who worked that much; of those, 723 were immigration inspectors.

That figure included 38 U.S. marshals, 27 agents of the Drug Enforcement Agency, one U.S. attorney and two tax division aides, the report said.

A 1931 law that set premium pay for immigration inspectors is "certainly more generous" than overtime or premium pay provisions for other federal workers, said Ben Wiseman, who is responsible for pay policy at Justice. "The only one that approaches it is the special overtime law for air traffic controllers."

The law provides for immigration inspectors at U.S. ports of entry to be paid as much as 2 1/2 days' pay for working up to eight hours between 5 p.m. and 8 a.m. weeknights; and as much as three days' pay for work on Sundays or holidays.

The complex overtime laws are "the results of compromises," best approached without too much insistence on logic, Wiseman said.

The 1931 law was passed when "Sunday was supposed to be a day of rest, and not long after (Charles) Lindbergh had flown the Atlantic. It is sort of an anachronism," Wiseman said.

Some immigration inspectors are able to earn more in overtime than the amount of their base pay, according to the payroll report.

Under the law, airlines and shipping companies pay a percentage of the overtime earned by the inspectors, an amount determined by how much of the overtime work was caused by late flight arrivals and the like, officials said. Of the $15 million paid to inspectors last year, almost $6 million was collected from the carriers.

Officials of the Immigration and Naturalization Service said they have only about 1,500 immigration inspectors. The 1,200 others included as recipients of the overtime pay total were investigators, adjudicators, deportation officers and other workers who are routinely called in to act as inspectors when the workload demands it, the officials said.

"Boats, airplanes and so on come in 24 hours a day," said immigration official Thomas Brobson. "So the 1931 act is something you just have to live with."

Salaries for immigration inspectors range from $10,500 for GS5 trainees to more than $25,000 for GS11 supervisors, official said. "Very few, probably fewer than 100," earn more in overtime than the amount of their basic pay, they said.

Under another category of overtime pay, 3,067 border patrol employes and investigators earned more than $11 million in overtime during the fiscal 1978, immigration officials said.

As law enforcement officers, they receive what is called "uncontrollable administrative overtime," which pays them at a percentage rate, less than the time-and-a-half that most people get. (Another example would be an FBI agent who must shadow a suspect and cannot stop work at 5 p.m.)

Deputy director Mario T. Noto of the immigration service said yesterday he will tighten up on the administrative overtime because "I think it is excessive."

Payroll officials said, however, that law enforcement officers often are not paid for all the overtime they work because of pay ceilings.

The federal government's overtime pay systems have become so poorly managed and chaotic that they invite fraud, waste and abuse, according to congressional investigators.

A number of possible criminal cases of overtime pay fraud are in various stages of investigation or prosecution by federal officials. However, Rep. Gladys Spellman (D-Md.) chairman of House Post Office and Civil Service Subcommittee on Compensation and Employe Benefits, said last week that she would be reluctant to turn over any more cases to the Justice Department until officials there have explained why their own overtime pay statistics are so high.

Justice Department representatives are scheduled to tesify before the Spellman subcommittee Friday.