A good percentage of those can be treated with medication, but also a good percentage of those will not continue any medication they are prescribed and their "evil" thoughts will resurface.
Another percent of people are born with conditions such as severe psychopathy that just seem outright evil, even though they just got given a bad hand in life.
Punishment either has zero effect, or the opposite effect on many of these people. Additionally, prison treats people so severely that they come out with a ton of side-effects which make them vastly more anti-social than when they entered.
Some people are irredeemable, but we need better systems for dealing with those. Right now we put them in mental facilities -- and they do need to be kept away from society -- but we need to take into account those people are born with those defects and they are not the product of their own making.
For the ones who are redeemable we need better support. Rehabilitation is unbelievably difficult. There is almost zero money for programs inside prisons that would help anyone on the outside. All the money goes into the punishment bit, because that is easy. The programs that do exist (cleaning, serving food, stamping license plates) are mostly "do busywork, it will make an honest citizen out of you."
Visit any halfway house where parolees are trying to reenter society and see how badly the system is stacked against their success. It's hard enough for a regular Joe to find a job in 2026, never mind someone who has no money, no phone, no bank account, no address and a criminal record.
Criminal justice is the hardest of the hard problems. Maybe ASI can figure it out...