The man, who is a refugee, had admitted to putting up the advertisement offering his baby girl for €5,000, but said it was meant as a joke.
On Thursday, the court in the western city of Duisburg decided to restrict contact between the man and his child, national news agency DPA reported.
It ruled that the man's wife, who is also a refugee, should have custody of the baby and move into special housing for mothers and children.
The man would be allowed contact with the child only under supervision, the court said.
The couple's nationality was not released by authorities.
The advertisement, which appeared online on October 11th for about 30 minutes before eBay took it down, sparked outrage in Germany and prompted police to launch a probe into possible human trafficking.
Several pictures of the black-haired infant were seen in the advertisement, which was titled "40-day-old child named Maria... for sale", according to local media.
The baby girl was handed to child protection officers during the investigations.