Because she is a Deltan
From an early version of the script:
ILIA:
I'm sworn to celibacy, Mister
Sulu. That makes me as safe
as any human female.
Sulu catches her eye but before he can reply, Decker has
moved in beside Ilia.
DECKER:
I know the Captain meant no personal insult.
ILIA:
(eyes on console)
I would never take advantage of
a sexually immature species.
(looks at him)
You can assure him that's true,
can't you?
Intercourse with a Deltan poses serious risks for non-Deltans. As such, Deltans entering Starfleet were required to take an oath of celibacy to avoid any fellow crew members being driven insane, etc.
“My oath of celibacy is on record, Captain.” Ilia kept her tone
respectful. “May I assume my duties now?”
“By all means.” Kirk nodded. He was sorry her oath of celibacy had
come up this way, but it was a Starfleet requirement wherever Deltans
served with human crews.
—Star Trek:The Motion Picture (Novelization)
Sex is a particular risk:
Deltans tended to work and travel in groups, or at the very least in
pairs, for a Deltan alone was terribly isolated. They required
emotional and physical closeness of such intensity that no other
sentient being could long survive intimacy with one of them.
—Star Trek: The Wrath of Khan (Novelization)
Indeed, even proximity to a Deltan could be risky, since they emit pheromones that can cause attraction in others. As such, the Deltan had better be dedicated to abstinence:
Kirk knew that the compelling attraction which Deltans exercised on
anyone of the opposite sex went further than mere physical appearance;
it was, literally, chemistry. Subliminal scents called pheromones were
released by both Deltan males and females, triggering hormonal
responses in most humanoid life forms of the opposite sex. It was
especially troubling to humans since the scents were outside their
normal olfactory range—just as a dog whistle is outside human hearing
range. But the effects of these Deltan pheromones were still felt by
them, and an unsuspecting human was likely to find himself in
considerable sexual excitement without understanding why.
—Star Trek:The Motion Picture (Novelization)