I think I should go ahead and throw away my flatmate's food
Why are you going to throw out someone else's food?
I bought it for them, I can do what I want with it.
It's not respectful to throw someone else's stuff away. You might harm your relationship with your flatmate if you follow through with your plans.
My intention isn't to hurt the person, I just want the extra food storage space for myself.
It really doesn't matter what the reason is it's still rude to throw out the food without permission. They'll be angry if they were planning to eat it only to find out it's in the garbage. If you need more space work with them to organize and divide up the space.