The treasuries are effectively zero-risk assets to the trust fund and they also pay interest. Just having the fund sit the on cash would not be efficient.
The money goes to the trust fund, the trust fund buys treasuries and meets it's outlays using the maturing treasuries.
Creating a debt obligation with yourself isn't typically the definition of zero risk. ;)
Or to put it another way, buying special issue treasuries isn't functionally different than Congress directly spending excess money in the trust fund and guaranteeing to pay more back later.
Just with additional steps and a thin veneer of impartiality and financial standards.
The money goes to the trust fund, the trust fund buys treasuries and meets it's outlays using the maturing treasuries.