In terms of dimensions there's several factors to consider: label size, stacking efficiency and directional integrity. If you want a nice big color photo of your product, a taller, slimmer container will allow for a large color background and plenty of text for both the front and rear labels. Depending on if it's skinny or wide will determine how other products can be stacked around or on top/below it. And some foods (like tuna) keep their shape/consistency better when laid horizontally to prevent from breaking up while being transported. Similar foods hold together better when the pieces are larger, so larger portions of canned fish have the typical vertical orientation. And of course there's only so much horizontal space that can be allocated per unit before the shelves burst at the seams.
For sealable cuboid containers, more and more containers are being modified with grippable edges to make it easier to handle, since the customer doesn't use the entirety of the product at once (http://ecx.images-amazon.com/images/I/81W3JCB8tHL._SL1500_.j...). Resealable bagged containers are also becoming more popular, as they reduce the amount of air in the container, pack more efficiently, save weight, and are easier recycled. (http://www.gofoodindustry.com/uploads/members/comp-1509/file...)
The shape is a compromise for volumetric efficiency, stackability, ease of manufacture, and field-toughness.
Spheres are highly impractical on all dimensions.
Caulk and pepesi (pardon my pun) don't come in spheres, squares, or rectangles either...probably for similar reasons.