I don't think Ender's game fits the standard criteria for YA. First off, the protagonist wasn't a high-school-aged teen for most of the story (or for any of it), even if he was rather precocious. The tale took place over a long time period, and the protagonist aged from a very young child to a pre-teen (or younger teen) during that time. YA tends to focus on shorter time frames with the protagonist being in the 15-18 age range. Secondly, the voice and narrative viewpoint wasn't really right for modern YA. As I recall, Card used a kind of externally focused third viewpoint (can't recall if it was omniscient or limited third with a greater narrative distance). There are exceptions, but YA tends to be closer. Third, and probably most important, the story wasn't written or marketed primarily to teenage readers, but to adult SF readers. Many teens, and even younger kids, will read stuff marketed to adults, but that doesn't make it YA. Some of the purpose of Ender's Game, as I recall, was to show the reader how children can be weaponized by adults, which is especially horrifying to adults.
Mind you, a lot of kids and teens read Ender's and related heavily to the character and his situation for reasons I never quite grasped. Maybe it was the sense of being manipulated or used, because Ender was certainly not a normal kid in a normal situation by any stretch.
There are still plenty of books written for adults that have child or teen protagonists in them, however.
Note, I am not an expert on this demographic, so my take on this is based on what I've read and on my memories of a book I read decades ago.
Did the YA category exist when Ender's Game was published? I don't think so. YA is a segment that was created by the Anglo-Saxon publishing industry, that likes so much to put books into categories! When I grew up, there was no YA. You read "adult" books soon enough.
There were certainly books written for and marketed to teens back in the 80s and before (I was a teen in the 80s), though the term "young adult" specifically to refer to this niche may be newer. I do remember they had a young adult section at our local library. There have been changes in the voice and style expected of YA fiction as well.