Why? Because they have far more applicants than spots, and they can do whatever they want! Some schools will be fine, many won't.
Online is considered less rigorous, more prone to cheating, etc., etc., etc. The grades and quality of instruction are consequently often not considered comparable to in-person coursework, which puts you at a huge disadvantage, even when a school will accept it.
Exceptions were made during the depths of COVID, but, med school is generally not online, the practice of medicine is generally not online, and the expectation is that your health will not prevent you from having an in-person education.
YOU need to figure out what a given school's policy is, directly with the schools, BEFORE you waste time and money applying. We can all go back and forth about whether it's fair, or necessary, but, it is what it is. Good luck!!