>To me, sexual relations with children is immoral, it is not proper behaviour in which an adult should partake.
It may be a moral issue, but there are pragmatic or non-moral reasons one may argue as Foucault did. You may find those reasons detestable and disgusting. That doesn't mean he was making any appeal to moral sentiment - he was just acting on what he finds beneficial or detrimental. Whether on behalf of sympathy for prisoners against the carceral state, or another reason.
>If he did not think himself an authority, on what merit would he petition?
He can do so not speaking on moral authority, but on a variety of authorities - the authority of a public intellectual, for instance. I don't think he was being a moral leader, or attempting to be. The people who would listen to him, the public at large, would not do so because of his moral position in their eyes. An authority as an enduring public intellectual with a strong grasp on philosophy and sociology within his tradition, for sure. A moral authority? Nobody has ever quoted Foucault in such a way.
His experiences would not excuse him (in your view; in mine, there is little to need an excuse if you examine his intentions), but they would provide a rational explanation for why he would forgo morality to expound his own opinions in pragmatic or non-moral reasons. He may have just not cared about morality (the same system that troubled him, I don't know) and reasoned on his feelings and pragmatism alone. I'm not trying to excuse him, I'm trying to explain him, though I'm really just speculating.