If he was shaking and getting the DTs, you absolutely did the right thing. Severe alcohol withdrawal without medical supervision can be deadly.
If you are in the US, call 211 next time and they should give you directions to the detox center.
Just for boundaries purpose, if it happens again, you need to let him know clearly that it is not acceptable to stop at your house drunk when he is too broke to afford booze. Obviously he needs to maintain and is in a bad way, time for him to seek help.