I actually just commented about this on another post, but I'll put it here too:
It's because most phones don't actually rotate the photo, they just add some meta-data that basically says "please rotate X degrees". That data is often either stripped or ignored when posted online. The best way to deal with this is to open the image in an image editor on your phone and rotate it before submitting.
Most likely! It takes less time to add that meta-data than it does to actually rotate the image, so most camera apps do that to make the picture-taking experience smoother.