The man from the Pentagon, Thomas J. O'Brien, was droning on smoothly at the hearing in the Capitol, extolling the wonders of the Defense Intelligence Service, or DIS, and the security mesh it weaves.

Before anybody at the Pentagon gains access to "sensitive compartmented information" - a designation higher than top secret and pinned on intelligence matters - he or she is put through a rigorous check by DIS and its 1,000 agents. The Pentagon sleuths go through the "subject's" background for no less than 15 years, checking out schools, jobs, neighbors and local police, to say nothing of the FBI.

"Our system is very good," purred O'Brien, who is the director of security plans and programs for the deputy undersecretary of defense. "Our experience is very good."

Then a piece of the Capitol's ceiling fell on him.

If you're so good, asked Rep. Les Aspin (D-Wis.), how come you clear people who enlist with phony names?

O'Brien, a stocky man with silvery blond hair, flushed. "That happens very, very rarely," he pleaded. He insisted he knew of only one instance, a sailor who came in on his brother's name.

Aspin, chairman of a House Intelligence subcommittee that is examining how well the intelligence guardians are guarded, said he knew of more. The congressman said he has heard that four or five servicemen a year are cleared for at least top secret despite their fraudulent enlistments.

In the time-honored way of dealing with questions from the Hill, O'Brien promised to look into that.

The sailor who slipped through the mesh was Robert X. of Glen Falls, N.Y., according to naval sources. Robert had been discharged from the Air Force for medical reasons and then truned down by the Navy.

So he went to California in 1975 and enlisted in the Navy under his brother's name. About a year later, and despite DIS, he received a sensitive compartmented information clearance and happily dealt with intelligence matters for a year and a half.

But Robert's conscience got to him and he owned up to his fraud. He received an honorable discharge for his honorable behavior, the naval sources said. One reason he went undetected was that the FBI's finger-print experts failed to match Robert's California prints with those they had on file.

All in all, as O'Brien made clear to Aspin this week, the lot of a Pentagon gumshoe is not the happiest one. There are all those new laws and court rulings, protecting privacy, letting people see and fix errors in their files, and forcing the FBI and others to throw away all that stuff they've been collecting.

The whole climate has changed, O'Brien observed with regret. "People are less willing to talk to investigators today." Why some local police forces won't even tell you if a person has been arrested, but will only supply convictions, he said.

DIS sleuths also have a terrible time in apartments houses, the subcommittee was told. "People just don't know their neighbors," O'Brien said. "It is almost a charade" to try and check neighbors more than five years back, so DIS doesn't.

Then there was that 25 percent budget cut Congress imposed in 1974. DIS responded by trimming its reports.

"We came up with a good-news-is-no-news concept," O'Brien explained. He meant the agency pares down favorable material on a "subject" and details at length the adverse matter.

But there was one bright note. Unemployment among college graduates has created "a good job market" for DIS. Its rolls are filled, as O'Brien put it, with holders of baccalaureate and more advanced degrees.