"I know it drives you nuts. But I'm not going to lower the drinking age," the presidential candidate said.
Army veteran Ernest Johnson, 23, of Connecticut, said one of the things that peeved him before he turned 21 was that he couldn't come home and drink a beer - even though he was old enough to serve in the armed services and die for his country.
Obama told Johnson he sympathized, but that setting the legal drinking age at 21 had helped reduce drunken driving incidents and should remain.
The Illinois senator was taping a round-table discussion with eight veterans that is to be broadcast by MTV on the fifth anniversary of the start of the Iraq war.
Howard Noel, 28, of New York City, told Obama he "looked at the military as a good thing" when he enlisted. But when he returned, he said he was scorned by friends and, for a while, was homeless.
"The problem has not been our military - the problem has been our civilian leadership," Obama said. "There's no way you should end up homeless." He said he would, if elected, put into force a program that would guarantee at least transitional housing for homeless veterans.
Seven of the eight veterans raised their hands when Obama asked who had suffered emotional or mental problems as a result of their service.
Christina Correa, 23, of California, said she believed she might have post-traumatic stress disorder, but that it was especially hard for women to find treatment. "They took my name down, but I never heard back," she said.
"The notion that you wouldn't have services available to you is inexcusable," Obama said. He said the military should start the process of treating soldiers suspected of post-traumatic stress disorder "before you are discharged."
The segment, sponsored by MTV and The Associated Press, was taped in the back room of "Whistles," a sports bar where a full blown St. Patrick's Day celebration was under way.
Before the taping, Obama circulated among the celebrants at the bar, shaking hands and getting his picture taken - in a pale blue tie.
Asked why he wasn't wearing anything green, Obama said, "This is embarrassing." He said since his hometown of Chicago held a big St. Patrick's Day celebration two days ago, "I sort of lost track" of the actual date.
But he said he would rectify the oversight before speaking later to a St. Patrick's Day dinner sponsored by the Irish Women's Society by wearing a green necktie. "I confiscated one from one of my staffers," he said.