Just giving a homeless person a house will not solve the underlying problems that caused them to be homeless in the first place. There needs to be movement on multiple fronts - mental health, physical health, rehab, job training, personal finance, etc.
If the solution was easy, someone would have done it. The uncomfortable truth is when you have someone who is addicted to heroin or fentanyl or meth who isn't really participating in society like everyone else..sometimes there's not much you can do for them. Overcoming addiction is incredibly challenging even for people with means and support systems. Without those, sadly the numbers are abysmal.