2FA doesn’t protect against phishing because the phisher can just create a form for the 2FA code and the victim, who already trusts the phishing page because they’ve already typed in their username and password, will give it to them.
2FA protects against attacks like trying passwords from a hacked database on other accounts with the same username.