I think it comes from a mix of DNA and upbringing.
I feel that part of my discipline background can be linked to coming from a big family. While there's lots of chaos in a big family, maybe my way of dealing with it was to build routines via discipline that restored a sense of order for me. For example, if the rest of the house couldn't be clean and organized, at least my room could be. (Though it had it's moments, to be sure.) It was my space, they were my things and it was my sanctuary (read: sanity).
I can't help but feel that some of my self discipline comes from attending a Catholic, military, all male high school. At my school, every Monday we had "inspection." At inspection, we were lined up in our squads (Order level 1), that were put into platoons (Order level 2), that were part of battalions (more order), which were part of a brigade (large scale order.) Each student had a rank (order again) and when the inspecting officer came around, they checked for shined brass, shined shoes, name tag, tie, pocket protector (geeks!), pressed shirt, pressed trousers, and hair not touching the ears or collar.
It was every bit like being in the Army as a teenager.
So my Sunday nights always involved a routine of shining shoes and brass, and making sure my uniform was pressed and ready to go. Over the years I learned a few tricks that made this easier, like buying a pair of Chloroform shoes. These are super shiny, expensive black dress shoes that I wore only for inspection. $70 at the time seemed steep, but it eliminated the need to shine shoes every week. Worth every penny!
I think all of these things, plus a lot more developed in me as time went on and to paraphrase the Doobie Brothers album, "What were once disciplines, are now habits." But I also feel that some of it is in a person's makeup too. It's as much a part of their personality as is being studious, artistic or a free spirit. My daughter has a fair amount of self discipline, for example.
The important thing to keep in mind is to remember to keep it in check. As I get older, I realize that I don't need to become a slave to my habits/routines and discipline. Life is too short to be too regimented. Sometimes though, it takes a conscious effort to do that though; to let go.
That's all I have time for right now. I've got to go iron my shirt for work tomorrow.