[deleted]
I don't think they realized there was anything to rationalize.
Gay people weren't the only people not released. There were regular criminals who were sentenced to the camps too. When the camps were liberated, these criminals were transferred to regular prisons.
Gay sex was illegal in the allied countries too. Gay people were considered common criminals, and transferred to regular prisons to complete their sentence.