There has been one plausible reason given for Dumbledore’s sexuality not being mentioned in the first books.
More specifically, books with supposedly LGBTQ characters were banned from school libraries (although I can confirm that The Marvelous Land of Oz got through the filter despite Tip getting magical confirmation surgery.) The first book after the repeal of that law was HP and the Half-Blood Prince, which J.K. Rowling would already have been well into writing, so the first book where she could even hint at Dumbledore’s sexuality would have been Deathly Hallows.
Section 28 was also a major reason why my schooldays were hell. Apparently the school dealing with transphobic bullying was seen as promoting “homosexuality”.