The incident happened at an induction base near Tel Aviv on Thursday when new recruits from the "Nahal Haredi" battalion, composed of Orthodox Jews, were eating.
The IDF said the army had promised its new ultra-Orthodox recruits that there would be no women around during their induction.
After the female officer was denied entrance to the mess hall, female soldiers who came to eat were also sent to another room usually reserved for officers.
The decision came amid ongoing debates in Israel over the issue of female service in the army, where religious ultra-Orthodox combat units are expected to serve in an increasingly greater capacity in the coming years.
Last March, the Israeli parliament passed the Equal Service Bill, mandating ultra-Orthodox enrollment in the army. Since then, the number of Orthodox Jewish recruits in the IDF increased by 39 percent according to Israeli government figures.
The law, which also mandates legal ramifications for individuals and religious schools that do not comply with enlistment, has been protested heavily by the ultra-Orthodox community.