Why does a phone company need your social security number?
Billing. For collections and credit reporting.
The question is, if it was not AT&T that got hacked then it was a "partner" business they shared data with, or sold it to, why did they share social security numbers? I cannot think of a single reason to share that with an advertising partner.