A federal judge last night temporarily barred the Agency for International Development from sending out checks for nearly $10 million in family-planning funds to foreign governments and U.S. organizations that were awarded the money after it was withdrawn from the U.N.'s family-planning arm.

AID Administrator M. Peter McPherson announced last week that $10 million of a $46 million grant earmarked for the U.N. Fund for Population Activities (UNFPA) was being withheld from the group because of its participation in China's family-planning program, which he charged involves coerced abortions.

McPherson said the money would be "reprogrammed" to other family-planning groups before the end of fiscal year 1985, midnight yesterday. According to an AID official's affidavit submitted in court last night, all but $50,000 of the funds has been reallocated.

U.S. District Court Judge Louis F. Oberdorfer, acting in a lawsuit filed yesterday by two House members and a population control group here, issued a temporary restraining order barring the government from disbursing the funds until a hearing next week.

Government attorney John Seibert argued that the order would create "embarrassment and/or difficulty" for the Reagan administration with foreign governments such as Kenya, Nepal and Tunisia that had been promised the funds after McPherson's "reprogramming" announcement Wednesday.

But Oberdorfer said he acted so the lawsuit could go forward. He said although he was "very, very reluctant . . . to involve the judiciary in any aspect of foreign relations . . . .I'm satisfied that the limited relief I'm granting tonight would not need to have that effect."

In the suit, the Population Institute, a Washington population-control group that receives money from UNFPA, and two House members, Bill Green (R-N.Y.) and Peter H. Kostmayer (D-Pa.), seek to require AID to provide the $10 million to UNFPA.

They argue that McPherson's action violated congressional intent to bar UNFPA from receiving AID funds only upon a presidential determination that the U.N. group "supports or participates in the management of a program of coercive abortion or involuntary sterilization." McPherson said last week he had made such a finding "pursuant to delegations of authority from the president and the secretary of state."