The U.S. federal deficit reached $2.77 trillion in fiscal year 2021, just shy of the milestone $3 trillion the Congressional Budget Office projected, the Treasury Department announced Friday.