The rotation is saved in the photo’s metadata. Lemmy removes the metadata from posted pictures pics use it can provide a time and gps location of the picture as well, so the rotation information is gone.
You can save the correctly rotated version as a new picture in any editing software and it will save/post correctly.
Edit: I had no idea you could edit/repost pics already posted! That’s great to know :)
Being able to edit post titles and content aftet posting is a definite plus to Lemmy vs. Reddit, though I could see there being a way to abuse that freedom.