There are two main reasons as to why you should lie on your back after having your hair transplantation surgery.
In the first three days after surgery, there is the risk of edema. For the edema/swelling to subside, it is best to lie on your back. Also, lying back helps in protecting your newly transplanted hair. This way the hair will not rub against something and get damaged or be displaced, and will be kept away from any potential risks.
Therefore, lying on your back for the first three days after surgery is essential to stop/prevent, or subside the swelling, and protect your hair from any damage.