We mostly need jail that’s not 100% punitive. If there were mental health services in there and a LOT less abuse, there should be zero issue with “locking up” mentally incompetent people: it would be exactly the 24/7 observation and help you’re asking for.