Corey Foster spent her Army career caring for wounded troops, both as a flight medic in the Iraq war and at Walter Reed hospital, so she looked forward to one of the most celebrated benefits of military service — health care for life from the Department of Veterans Affairs. Then she walked through the door at a VA Medical Center in Temple, Texas.

“You felt like you were a piece of meat,” said Foster, 34, who retired as a sergeant. “Standing in line at the registration desk, I was getting comments from the male patients behind me, looking me up and down. It was a major source of discomfort.”

The treatment was the same at the Veterans Affairs Medical Center in Murfreesboro, Tenn., where Foster moved after living in Texas. At that point she gave up and opted for her husband’s insurance outside the department. “They need to make the facilities not feel like an old soldier’s home,” Foster said.

An entrenched, sexist culture at many veterans hospitals is driving away female veterans and lags far behind the gains women have made in the military in recent years, veterans and lawmakers of both parties say. Although the Department of Veterans Affairs has scrambled to adjust to the rising population of female veterans and has made progress — including hiring more women’s health care providers, fixing basic privacy problems in the exam rooms and expanding service to women in rural areas — sexual harassment at department facilities remains a major problem.

“Changing the culture has been an ongoing, overarching goal,” said Dr. Patricia Hayes, chief consultant for women’s health services at the veterans agency. “We want women veterans to feel respected and safe and secure.”

At a recent hearing with veterans agency officials on Capitol Hill, Rep. John Carter, R-Texas, described the treatment of female constituents trying to obtain VA health care. “It’s like a construction site,” he said.

Carter cited the same medical center in Texas that Foster had used — and noted that the Women’s Trauma Recovery Center within it was moved last year to a female-only facility in Waco so that women, who said they feared for their safety, could receive treatment without facing harassment.

Rep. Will Hurd, R-Texas, was visibly frustrated as he described women abandoning the center in his district because of harassment. “This is the biggest concern I hear from female veterans,” he said.

Brandy Baxter, who served as a senior airman in the Air Force, loves the care she receives at the women’s health clinic through the Veterans Affairs center in Dallas. But she hates the elevator ride to get there.

“The male vets give me the once over with their eyes,” she said. “I look them right in the eye, just to tell them, ‘I’m checking your height, your weight, your skin color — just in case I need to report you.’ ”

This year, the House Veterans Affairs Committee will establish a task force to address women’s health care, and harassment is expected to be front and center.

“This is about the physical transformation of our facilities,” said Rep. Mark Takano, D-Calif., the new chairman of the committee.