An ugly week for stocks leaves the S&P 500 with its biggest loss since March 2020.