A court in Hamburg upheld an injunction taken out by the chancellor against the DDP news agency ordering it not to repeat the hair-dye allegation, originally made by an image consultant.
It said the journalists should have attempted to verify the accuracy of the the information, and given Mr Schroeder the right to reply.
The DDP had appealed against the injunction, describing it as a gagging order and arguing that it was impossible to thoroughly check the accuracy of every quotation it published.
"It's incomprehensible," DDP's editor-in-chief, Bernd von Jutrcenzka, told BBC News Online, adding that he intended to appeal.
"We're confident that at this next appeal we'll be successful - otherwise the case could have real implications for media freedom."
Nail-biting election
The vigour with which the chancellor has pursued the case has been condemned by some of the German media as an unattractive display of vanity and humourlessness.
The ruling comes as the German Government voiced outrage at the cover of the latest issue of Stern magazine, which depicts a mock portrait of Mr Schroeder, nude apart from a fig leaf.
The headline reads: "The Naked Truth, Can Schroeder Still Win?"
A red and green fig leaf symbolises his Social Democrat party's coalition with the Greens.
"We find it absolutely tasteless," government spokesman Bela Anda told BBC News Online. "Stern appears to have lost any sense of decency."
In this case however, Mr Anda added, the chancellor had no plans to take legal action.
Grey hairs
In the hair-dye case, Judge Andreas Buske made clear he was not ruling on whether Mr Schroeder's hair was dyed or not.
The affair began when the news agency annoyed the chancellor by carrying remarks made by image consultant Sabine Schwind von Egelstein, who suggested teasingly that the 58-year-old chancellor should admit that he dyed his hair to keep it looking dark.
Mr Schroeder responded with an instant rebuttal of the hair allegations, which the news agency carried.
A series of witnesses, including Mr Schroeder's hairdresser, also stepped forward on the chancellor's behalf to rebuff the claims.
In written testimony he said Mr Schroeder had a small number of grey hairs which proved he had not used dye.