Kirk ignores the prime directive as if it was no bodies business. He feels like anything is possible. I always found it funny how they had a loose cannon like Kirk as a captain. And felt sorry for poor logical Spock that kept trying to steer Kirk away from all his insane notions.
No, because he's human. He wanted to give the benefit of the doubt to a teenage boy who had been isolated for years. And this was not a violation of the Prime Directive. Charlie was human, from a Federation family. If helping him is a violation of the Prime Directive, then rescuing any ship wrecked individual is also a violation. As well as defending, say, Vulcan from an attack, or the Andorian home world from a rogue comet.
The real issue with that episode (IMO) is, why can't they just remove his superhuman powers since he's now among other humans and no longer needs them to survive? They can grant him powers but can't also remove them? That's not believable at all without a good explanation, especially since they were powerful enough to instantly undo all the damage he did on the Enterprise.
The problem was, Kirk didn't understand what he was dealing with. He didn't realize just how the Thasians had helped Charlie to adapt to living among them, and didn't understand Charlie had been given incredible powers to have whatever he wanted, and the Thasians couldn't discipline him because they literally couldn't touch him, and his behavior wasn't originally a problem for them. But the Thasians themselves also didn't realize how the human psyche truly worked, and didn't realize they'd spoiled this kid rotten in a way, giving him everything he wanted...until he came in contact with other humans.
So then, when Charlie realized he was in a place where people weren't so eager to give him what he wanted, or do what he wanted, he went on a power trip to try and get it anyway, realizing that an entire ship full of helpless humans couldn't stop him. Kirk pretty much had no clue he'd brought a dangerous megalomaniac on board.
Small wonder the Thasians were forced to take him back and subject him to a nearly empty, human-free existence for the rest of his life, since he was too dangerous to live among his own kind anymore.
It was just as well that the Thasians did show up, because I'm not sure if Kirk's crew would have been able to kill Charlie. All the kid would have had to do was make everyone who wanted to kill him disappear or have their phasers blow up in their faces. But he couldn't do anything to the Thasians because they had the same powers as him and could stop him.
To answer the OP’s question first, Kirk was an optimist. Or maybe just an egotist. He never thought there was anything he couldn’t handle.
Later on remember his famous, “I don’t believe in the no win scenario” comment in The Wrath of Khan.
I agree that Charlie would probably have been able to dispatch a lot of the crew before they could find a way to kill him. In his short time onboard he became increasingly frustrated and angry when the crew did not bend to his wishes.
Remember when he barged in on Yeoman Rand and scolded her for locking her door? The boy had NO boundaries!
Even without super powers people like that are incredibly annoying. I used to date a guy who was very pleasant but at the same time he was incredibly pushy, like Charlie. I had the habit of keeping my back door unlocked to let the dogs in and out. My fault!
We had only been dating a few months and one day he told me rather proudly that he had stopped by, but I wasn’t home, so he ate and watched TV!
He thought he was welcome any hour of the day or night. He would just walk in, check out the fridge, help himself, etc. He even walked upstairs into my bedroom one day unannounced. He thought he “heard something”.
The last straw was when he came over unexpectedly and barged in on me in the bathroom! Didn’t even knock.
He started to complain that I was locking my door! Shades of Charlie X!
This character is very similar to the one played by Billy Mumy in the Twilight Zone episode "It's a Good Life". The child was a monster because no one had ever been able to teach him social responsibility.
There was an interesting, though inferior, sequel to that episode in one of the reboots of the series, again starring Mumy - where he was a father!
Tangential to my comment above, in addition to the destructiveness of children (that is, hat members of society have to be taught responsibility), there was also an element of power corrupting, a la Gary Mitchell.