Most handguns use more moving parts than a shotgun. These parts have to be fitted into a smaller package and still work reliably - no small feat. The most common repeating shotguns used are pumps which use a much simpler type of action which is actuated by hand. Single-shots and double-barrels are even simpler than pumps, and use even less parts that require less fitting (nowadays due to CNC machining). Semi-auto shotguns - whether gas or recoil operated - use fewer parts as well. To make a long story short, over-the-counter shotguns do not need to be as intricate or as well-fitted as handguns.
While you can buy a handgun for $250 and a shotgun for $15,000, as the old saying goes, you get what you pay for. The cheaper the handgun, the rougher the action and less reliable it can be. The more expensive the shotgun, the more of a work of art it becomes.