there is no AI in LrC that determines what should be the top based on image content. And, as Clee01 and Hal siad the camera supplied info about which way the camera was oriented when shot. if a lot of your images are not top side up when you import them, look for a setting in your camera to assure that it is enabled.
To fix images that don't hat the top on top, in the grid, select a bunch that are all incorrect in the same way (e,g. all need to be rotated 90 degrees clockwise), and with them all selected use the rotate buttons to turn them and they'll all be changed the same way.