Why does my lower back hurt when I lay on flat hard surfaces?

Hmmm. Perhaps because they are hard and flat? If you happen to lack 'personal padding' (= are skinny), then the pressure of your body on a few contact points where it impacts the hard surfaces can cause pain. Softer surfaces allow the pressure to be spread over wider area and tend to not cause pain. Use a cushion/pad/something to prevent pain.