Stockpiling is a rather straightforward operation. In addition, the benefits of stockpiling are both rivalrous and excludable. Ie stockpiles are not a 'public good'.
So the private sector is perfectly capable of stockpiling, too.
But the private sector generally doesn't stockpile, because the cost of maintaining a stockpile exceeds any immediate economic benefit of doing so. It is economically inefficient almost all of the time. Very occasionally it becomes useful, but current accounting practice, corporation law and shareholder demands do not have mechanisms for incentivising it.
One of the key roles of government is to provide services that are economically inefficient but are a public good.
So the private sector is perfectly capable of stockpiling, too.