Establishing good posture in your setup positions you to make a fluid, powerful golf swing. Bad posture, on the other hand, can not only cause problems in your swing, it can cause long-term damage to your body.
To set up with proper posture, make sure you first bend in the hips, not in your waste or middle back. It is essential that you not let the back slouch. Although when viewed from the side, your spine is not perfectly straight, the spine should be as straight as it is when you are standing erect, from the top of your neck down to your backside. Maintain this posture from the takeaway all the way to the follow through. This makes the swing more mechanically correct and will make it much easier to hit the ball solidly.
You'll also want a slight flex in the knees that places them directly over the balls of your feet. Your weight should be distributed evenly on the arches of your feet, not the toes or heels and you should feel your backside sticking out some.
Bending too much at the waist causes slouching and balance problems. Conversely, standing up too straight makes it difficult to move the arms and torso together, which negatively affects the swing plane and ball contact. Check your posture in a mirror frequently to stay consistent.
Overall, posture is one of the most important aspects of the golf swing. Finding the correct posture and keeping it consistent will have you on the right track towards a better golf swing.