Why is the shape of the cargo compartment similar in large aircraft?
The answer lies in the existence of something called a Unit Load Device (ULD) -- basically a cargo pod for aircraft that's the equivalent of the shipping pallet.
ULDs allow oddly-shaped cargo (bags, assorted-size boxes, etc.) to be loaded efficiently in a standard volume and easily secured for flight (using hold-down lugs in the floor).

The shape of the cargo deck is designed to pack in as many ULDs as possible:

and as you can see from the cross-section the sloping sides on the bottom are a concession to the circular cross-section of the fuselage/pressure vessel.

Some other advantages of ULDs as they pertain to airline operations and baggage loading are described over on this question.