Someone originally thought it would be a good idea to ignore EXIF data, and by the time someone else cared enough to address it, they were worried about breaking sites that had bad rotation EXIF data if browsers suddenly started honoring it.
Mozilla tried to add image-orientation: from-image CSS for this purpose, so sites could say "no actually the EXIF data really is good", but then no other browser vendor followed along.
So as usual, everything in computer science is just terrible for the sake of legacy compatibility with the first implementations ever made.
It works fine when you open the image directly, but it will not apply EXIF corrects for inline images (<img> tag). There are JS libraries that load the image as file data to read the EXIF data and apply the correct rotation, but those fail in some cases (HTTPS trying to load data for an HTTP-linked image, for example).