It has been explained a few times that its more related to the fact that stores stock only just enough toilet paper to keep up with demand which is usually almost perfectly regular. Even if everyone just grabs one more bag than they normally do, its enough to totally wipe out the stores.
Where as with other things, you could grab a months supply of cans and pasta and there will still be so much left, as well as the fact that not everyone is grabbing the same kinds of foods so the hit is spread over pasta, rice, flour and a huge range of canned food.