Holding $3 Trillion in boring American gov securities seems like a safe way to shelter itself from price fluctuations if the FED decides to play with the interest rates.
China should have never bought as many treasuries as they did. They should have bought harder assets, like oil company equites, timber and farm land, mining equities. When they tried to buy an oil company, congress blocked them. There is still no reason they shouldn't have bought diversified assets.
Providing cheap financing for US government during the 2000's, was neither good for the US, nor for China. The US got an asset bubble exacerbated by the cheap money, and the Chinese now have dollars that buy 1/2 as much as the dollars they used to buy the treasuries.