One of the groups, DKT International Inc., has refused to sign the pledge because it has been helping in the distribution of condoms to prostitutes and other sex workers in Vietnam.
Last year DKT sued the U.S. Agency for International Development, for violation of their free speech rights by a 2003 law that requires them to explicitly oppose prostitution and sex trafficking as a qualification for part of a $15 billion AIDS program.
In May, U.S. District Judge Emmet G. Sullivan taking sides with DKT, said that the funding conditions demand that groups "parrot" the U.S. government's position on prostitution.
On Tuesday the Justice Department, in its appeal, called the funding condition "highly germane" to the overall goal of fighting the spread of AIDS and HIV.
The government said, "Congress could reasonably determine that the government's efforts to stamp out prostitution and sex trafficking would be most successful if HIV/AIDS services are provided by organizations that affirmatively oppose two underlying causes of the disease."