This is a very good question but it will not have a definite answer. Teams may differ a bit in roster management procedures plus the answer varies over time, speaking historically.
Today, though, MLB teams typically do this:
- five starting pitchers
- three middle relievers
- setup pitcher
- closer
That's 10 players so far, out of a maximum of 25 roster slots. Depending on whether your league has it, leave a slot for the DH. Now we are down to 14 roster slots remaining for 8 fielding positions: C, 1B, 2B, SS, 3B, LF, CF, RF.
So simple math does not say "keep two of each." Woe betide the team that does not have two catchers, though!
To continue, then:
- two catchers
- four starting infielders 1B, 2B, SS, 3B
- three starting outfielders LF, CF, RF
That's 19 players in total now, 20 if you include the DH.
That leaves five roster slots for which a GM can be creative. Obviously, five do not provide one-on-one coverage for the four infield and three outfield positions. These five guys are called utility infielders and utility outfielders. They need to be able to play more than one position to provide adequate backup and therefore appear in multiple positions on the depth chart.
When I said "speaking historically," I meant that back in time, teams did things differently. For example, in the early 20th century, pitchers were expected to pitch many more innings than they do today. Therefore, teams carried only five or six pitchers in total, leaving that many more slots for position players. Back then maybe they could have one-on-one backups or more platoon situations (players regularly sharing playing time, perhaps L v R / R v L). Today, though, it's pretty much as I laid it out above.