If homeless shelters are shitholes, neglected, understaffed, with indifferent and uncaring (or abusing) personnel, with no boundaries between the inmates, so that dangerous and unstable people make it hell for the more well adjusted homeless people living there without recourse, then many or most homeless are not going to want to stay there.
And if you have strong boundaries and rules, there's a subpopulation that won't be allowed to stay there.
(Most places have something in-between: policies that exclude a fair number of homeless but still leave enough behavioral issues to produce dangerous and unpleasant places).
Of course, resourcing is part of the problem, but it also just can't be one-size fits all.
There's no reason to expect asylums to be any better, the only difference is that people are forced to be there.
If we see that someone in freezing weather prefers sleeping outside to sleeping in a homeless shelter, we're forced to reckon with the fact that homeless shelters must be terrible.
If we lock this person up in an equally terrible asylum, we can ignore that.