Some servers can opt into extreme "are you a human?" validation and SMS verification is a good, universal signal of that. It helps prevent botting, alt accounts (frequent reuse of that number shouldn't be possible IIRC), and ban evasion.
Also, if Discord itself notices weird activity coming from your account that looks like a selfbot (a program pretending to be the client via Discord's private API) or automation, it can pop up that verification flow. I'm guessing extremely abusive shared IPs can also trigger this.
But AFAIK you don't have to attach your phone number to continue. (I don't remember if it only suggests to link your phone for 2FA or that it auto-links and you can remove phone 2FA afterwards) Discord have outright denied selling or forwarding your info, and they don't show or plan to show ads. In that case, what's the issue with one-time phone verification in some cases?