Why does my back crack when I go lie down?

Back cracking. "cracking" of joints is a normal phenomenon. When you pull on a finger, your knuckles crack. Virtually any of the other joints in your body will do the same thing if you apply enough force. In this case remember that your spine is a collection of complex joint articulations and with motion cracking/clicking is common. It also implies that you are flexible, which is good.