Starships of any type are always built with the intention of carrying some amount of cargo onboard. The starting capacity of the ship depends on the overall purpose of the vessel. Starship manufacturers always create these vessels with the potential to be expanded; otherwise continued profit would not be possible. The method by which the cargo storage is engineered into modern starships allows for expansion using a fairly simple but devious segmented system of expansion.
Essentially, the cargo holds are built with the explicit intention that the ship owner will return for more expansions. The process is fast and relatively inexpensive in terms of manufacturing costs. Depending on the ship, there are always a maximum number of possible expansions before the overall structural integrity is compromised.