More or less the entire French Intellectual establishment argued at that time for "the decriminalization of all consensual relations between adults and minors below the age of fifteen".
While I agree that seems extremely stupid, it is based on a morally tenable argument that people under that age could give consent. That may be incorrect but if accepted as a premise would justify their position.
So if Foucault believed this and his moral arguments derived from that, it would seem unwise to dismiss all his moral authority just because you believe he was wrong on this point.
I personally think he is totally wrong and that even people at the age of eighteen struggle to know their own minds clearly with regard to consent. However I do not as a result think Foucault is impossible to take a moral lead from.