I think you're probably born into it. You are born to a certain temperament, and then, armed with that temperament, you go out into the world and search for a code to live by.
If you are of an independent frame of mind, you really don't want to adopt someone else's code. You like the search, (and it may be a "lifetime" search), you want to pick and choose, you want to add elements to your self-constructed code, you want to build your own code based on people you respect and admire.
But you want to make it all your own. You want to measure the world, and the things in it, with your own instruments. You don't want ride with the herd. You don't care what's popular, you don't care what everyone else is doing, you don't care what everyone else likes.
You want to discover your own value system. You want to assign your own values to what you think is important. You want to value, what you truly value, on what you think is truly valuable. And you are happy that you get decide. Everything. You are in charge.
You don't care if the road is lonely, you don't care if no one sees what you see. You aren't really trying to bring others along with you. You take your own road. If you see fellow travelers on that road you are surprised, pleased, but those lonely stretches let you breathe, and think and you live for those lonely times too. It's in your code.