It's a great question, and an important question. With the loss of traditional jobs and a move to service-industry economy in North America, personal training is a way to earn a relatively good living while helping others.
In my opinion, there is a huge shortage of good trainers in the workforce.
Now it's relatively easy to become a certified personal trainer. Simply look up one of the popular certifications (ACE, NSCA-CPT, or whatever certification the gym you want to work at requires), get their study materials, and then pass their test. Then you certified and can be a trainer. That's it. (So it's easy to see why there are so many bad trainers out there. Remember that the more people the organizations certify, the more $$$ they make...)
However, to become a good trainer, you will need to learn much, much more and invest far more time and education than you need to just get a quick certification.
You will need to start by mastering the basics such as anatomy, physiology, biomechanics, and an introduction to sports medicine.
For without this foundation, it is easy for a trainer to fall for the latest gimmicks and fads. If you don't know how the central nervous system controls the muscles, then standing on a wobbling board while doing biceps curls with a rubber band while reciting your ABC's backwards might seem like a good idea. But if you have a strong education in the foundations, then you'll take one look at that stuff and realize its bunk.
Fortunately, you can learn as much studying on your own as you could by being enrolled in a University Kinesiology program.
The plus side of going to University is that you will get a recognized degree and it also happens that a University or College degree (any subject however) is a pre-requisite for possibly the most recognized certification, that of the Certified Strength and Conditioning Specialist (CSCS).
However, the obvious downsides of University are the required investments in time and money. You must study on the University schedule and the fees are substantial.
One additional downside to a University education is the heavy emphasis placed on aerobic exercise science. Not only has this lead to the "You must do aerobics for fat loss" mentality, but also to the ill-advised "high-carbohydrate, low-fat diets are best for fat loss and health" nutrition recommendations.
While some coaches regard the formal education process as un-necessary, and feel that all the requisite knowledge can be gained on their own and in the trenches, I am a strong supporter of a formal education - provided the quality of education is high. Perhaps these coaches attended less than stellar Kinesiology programs (which I know do exist).
However, the education that I attained from McMaster University is without a doubt the reason for the quality of my programs and the level of my knowledge. Most influential was the neuromuscular physiology course taught to me by Dr. Digby Sale at McMaster University. But since you will never have the opportunity to attend his classes, I recommend in his place you read:
Supertraining - by Mel Siff
The Science and Practice of Strength Training - Dr. Vladimir Zatsiorsky
Either way, as Michael Masterson of EarlytoRise says, expect to spend 1000 hours of study to become competent (as he suggests is the case with any discipline). Of course, having a good mentor can significantly decrease the amount of time you will need to study (perhaps by 50%).
So those are a couple of roads on how you become a competent personal trainer. But they aren't the only ones. I've even met former University-educated engineeers that are great trainers, as they seem to bring a unique perspective to training.