The Luhn algorithm isn't meant to validate whether a SSN number is valid. Only that it is in a valid format. It helps to catch incorrectly entered numbers and make a hacker's/spammer's attempts to break your system more difficult. It isn't meant to stop incorrect numbers from being entered.
This algorithm is also used for credit card numbers in the US. But test card numbers like 4111111111111111 will pass just fine. It is very helpful in catching bad numbers before you attempt to make a payment which incurs a cost every time you do even if it isn't successful. But to ultimately know if a credit card number is good you need to actually charge against it.