WASHINGTON — Despite being treated by the Veterans Affairs Department for psychiatric issues, no red flags were raised that might have prevented Aaron Alexis from entering the Washington Navy Yard on Monday and gunning down 12 people.

There is a growing list of questions about how Alexis, who had a history of infractions as a Navy reservist, mental health problems, and run-ins with the police over gun violence, gained and kept a security clearance from the Defense Department that gave him access to military bases, including the Navy Yard, where officials say he opened fire before being killed in a gunbattle with officers.

Time and again, Alexis’s behavior fell below a level that would have brought a serious response, like a less-than-honorable discharge from the military or involuntary commitment to a mental institution, experts and officials said.

But the sheer number of episodes raise questions about the government’s system for vetting people for security clearances, including the thousands of contractors who help run the nation’s military and security system. Though the cases are different, the access granted Alexis, a former Navy reservist who as an independent contractor serviced Navy computers, raises questions similar to those raised about another outside government contractor, Edward J. Snowden, who leaked national intelligence secrets.

“These two incidents combined suggest to me a very flawed system for granting security clearances,” said Senator Susan Collins, Republican of Maine, who called for a congressional investigation into the granting of security clearances to government contractors.

On Tuesday, President Obama ordered the White House budget office to conduct a government-wide review of policies for security clearances for contractors and employees in federal agencies. In an interview with Noticias Telemundo, the president said the nation did not have a “firm enough background check system.” He also called once again for Congress to enact legislation to keep guns out of the hands of criminals and the mentally ill.

“I do get concerned that this becomes a ritual that we go through every three, four months, where we have these horrific mass shootings,” he said.

Senior Pentagon officials also said Defense Secretary Chuck Hagel intends to review physical security and access at all Defense Department installations around the world.

Many planets aligned to place Alexis, 34, at the start of the workday in the Navy Yard with a Remington pump-action shotgun firing down from a balcony and killing the employees, all civilians, police said. As an honorably discharged veteran, he cleared a basic hurdle to receive a Defense Department security pass. Despite his being investigated by police departments in Seattle and Fort Worth, Texas, for firing a gun in anger, no charges were filed that would have shown up in his FBI fingerprint file. Despite mental health issues — he twice went to Veterans Affairs hospitals last month seeking treatment for insomnia — he was never committed and so was legally able to buy in Virginia the weapon police said he used in the shootings.

“The system didn’t pick up the red flags because the red flags in this case had not been fed into the system,” said one Pentagon official. “Perhaps we need to look at the ‘filters,’ and whether some sorts of behaviors and incidents, even if they do not rise to the level of punishment, should nonetheless be part of the files for review.”

In the search for more information — and especially the unanswered question of motive — federal and local authorities have interviewed hundreds of people and are poring through the contents of Alexis’s Yahoo e-mail account.

Alexis had shown a “pattern of misbehavior” during his four years as a reservist, according to Navy officials. That pattern caused some of his commanders to consider giving him a general discharge — one level below honorable, which could have derailed his security clearance.

Instead, Alexis received an honorable discharge from the military in January 2011, after he had applied for an early discharge under the Navy’s “early enlisted transition program.” A major reason, officials said, was that his misbehavior in the Navy was not violent. It included insubordination, traffic violations, and being absent without leave — two days he spent in jail after a fight in a bar in DeKalb County, Ga.

Alexis was also twice investigated by other police departments in shooting episodes — once for firing through his ceiling in Fort Worth, and another time for shooting out a car’s tires in Seattle, during what he described as an anger-fueled blackout.

He had a host of serious mental problems, including paranoia and a sleep disorder.

Alexis, employed by an independent contractor called the Experts, worked on half a dozen military bases from North Carolina to Rhode Island this year, said the company’s chief executive, Thomas E. Hoshko. If he had known of the police reports about Alexis that have surfaced in the news, “we would have never looked at him,” Hoshko said.

In any event, it was the responsibility of the Defense Department to grant Alexis his security credential allowing him onto bases, known as a Common Access Card.

Pentagon officials said the Navy was responsible for his clearance, using a check of FBI records and another database with the Office of Personnel Management.