But if you buy a rifled barrel, wouldn’t the rifling be ruined by firing shot through it?
Possibly.
That’s why you switch back to the smoothbore barrel before shooting shot.
It’s about a two-minute process, and can be done by hand on shotguns.
Also, it appears that most modern shotgun barrels have “choke tubes”, which change the barrel choke without changing the barrel.
Rifled choke tubes are available, and much cheaper than spare barrels, although they do require a device resembling a short screwdriver to change them. Again, the swap-out takes about a minute.