Just because you get constipation doesn't mean you are unhealthy or even that you have an unhealthy lifestyle. You can follow a high-fibre diet, exercise every day, drink lots of water yet still get constipation from time to time. Even from childhood some people just seem to be more susceptible than others. There's really no need to feel you've brought constipation on yourself.
However, certain things make constipation more likely:
Diet- Dietary fibre provides the bulk that helps to speed the passage of waste food through the bowel. Lack of fibre results in harder, more compact stools, which take longer to pass through.
Lack of fluids- the body needs 1.5-2 litres a day to function efficiently. Without sufficient fluids, waste matter dries out, making it harder to move through the bowel.
Lack of exercise- if you don't exercise often, things can slow down including the muscle contractions that move waste matter through the bowel.