There is many benefits of a shotgun.
The first is that they are much easier to use to hit a moving man size target with minimal skill.
Isn't the range of a shotgun too short to stop an escape?
They have rifles in the towers.
Keep in mind this is not humane hunting where all the pellets need to strike or completely drop the target at long range. If the person running away is merely wounded by a pellet or two that is drastically going to reduce their ability to successfully escape or avoid additional shots.
They will be slower, dogs can track them easier, and they have a limited time before they need medical attention.
So it does its job at longer range against people running away. It also is quite lethal at shorter ranges.
Another added benefit of only arming the guards on the ground with shotguns is that if inmates do manage to get that shotgun the distant rifles in the towers can easily dispatch the armed inmate on less than equal footing.
If the armed inmate ends up indoors they can also send in a tactical team with body armor that will easily stop the pellets of the buckshot only shotgun much more easily than rifle rounds.
So it makes sense that the guards with the highest chance of being disarmed have shotguns.
So arming the guards on the ground with shotguns has many advantages, performs adequately against prisoners, and has minimal disadvantages.