Goulard, who was previously a member of the European Parliament, said she could not remain in the government while there was a possibility that she could be investigated over alleged misuse of expenses at that parliament.
Her resignation comes as Macron carries out a minor reshuffle of his government following parliamentary elections on Sunday which handed him and his allies MoDem a commanding majority.
Goulard had only been in the defence job for a month following Macron's election to the presidency.
But she said the possibility of an investigation made it difficult for her to stay in the post given Macron's agenda to clean up politics.
“The president is committed to restoring confidence in public office, reforming France and relaunching Europe,” she said in a statement.
“This reform agenda must take precedence over any personal considerations.
“That is why I have asked the president, with the agreement of the prime minister, to leave the government.”
Earlier this month, Paris prosecutors opened a preliminary investigation into claims in the Canard Enchaine newspaper that MoDem was using European parliamentary funds to pay staff based in France.
MoDem's leader Francois Bayrou was a key backer of Macron's one-year-old Republic on the Move (REM) during the presidential campaign and whose support was crucial in winning centrist votes for the new president.
France's Prime Minister said Bayrou himself was safe in his role as Justice Minister but Macon's Minister for European Affairs , Marielle de Sarnez, another member of MoDem being investigated over the fake jobs claims, has suggested she too could leave the government.
MoDem won 42 seats in the parliamentary election while Macron's party crushed its rivals by winning 308 seats, giving their centrist alliance a solid majority in the 577-seat National Assembly.
Macron has already used the post-election period to fine tune his government and remove a scandal-hit minister.
On Monday, the president asked close ally Richard Ferrand, who is embroiled in a conflict-of-interest scandal, to leave the cabinet and instead seek the leadership of REM's parliamentary group.
In accusations also levelled by the Canard Enchaine, Ferrand is said to have favoured his wife in a lucrative property deal with a public health insurance fund when he headed the company.
Ferrand, who was a minister with responsibility for territorial cohesion, has accepted to make the switch.
Macron is expected to name his new cabinet on Wednesday.