The rumors that Dr. Mid-Nite (McNider) was gay have been in fandom for many years. Going in that direction would have been simpler, but much quieter. The question of why not both might be asked.
It's also true Alan's marriage history was a mess. It was hugely convoluted in order to get him kids to take part in Infinity, Inc. Hidden twins and a mentally ill mother make for an overly soap opera story. It's messy regardless of Alan's Kinsey score. Retconning Molly Mayne to be a beard for him given the times seems to be a simple way to cover up Alan's being gay with a pair of characters who developed respect, if not two-way romantic love, for each other.