There are a couple of different reasons, based on the properties of the game.
1. There is a weapon hierarchy, and pistols are at the bottom. A person is supposed to replace, or stop using, a pistol as soon as they find something "better".
2. It's there as a legitimate backup weapon. Pistols are only meant to be used if you run out of ammo for everything else. This style of games tend towards low ammunition amounts, to make it at least possible that you could need it.
3. They make pistols special. This is almost certainly by adding silencers to the pistols. Historically there is some precedent, as silencers were created for pistols before rifles.
4. Inventory issues. In some games you can only carry so many weapons, but pistols get their own special slot, letting a character carry just one more weapon and save their heavier stuff for special occasions.
5. And speaking of weight, in a game with a limited inventory, pistols (and sometimes their ammo) are light weight and/or smaller letting you carry one more weapon without having to really sacrifice anything else.
6. They are doing something ridiculous. IE duel-wielding has always been a thing in video games, and duel-wielded pistols is a very cinematic look.
7. They take advantage of the pistol's properties. This is rare, but some games remember that pistols are one-handed, so technically speaking they can be used if your other hand is engaged, such as when you are climbing a ladder or dragging something with one hand.