Why does cribbage have 2 pegs for scoring per player?
It is exactly as Wikipedia states, the second peg is used to keep track of the previous score in order to prevent mistakes in scoring. Don't forget that since the score is calculated frequently and there are no marks on the cribbage board indicating place it can be very easy to lose track of where you where starting from.

Wiki


  Visually, cribbage is known for its scoring board—a series of holes ("streets") on which the score is tallied with pegs (also known as "spilikins").[10] Scores can be kept on a piece of paper, but a cribbage board is almost always used, since scoring occurs throughout the game, not just at the conclusion of hands as in most other card games. Points are registered as having been scored by "pegging" along the crib board. Two pegs are used in a leapfrog fashion, so that if a player loses track during the count one peg still marks the previous score. Some boards have a "game counter" with many additional holes for use with a third peg to count the games won by each side.


Note in the full quote it does say in there that the scoring can be done on paper but is frequently not done that way because of how fast the score changes.

As a side note most how to play videos that I have seen use 1 peg to show the current score and the second peg to show the previous score. When they score again they just move the peg in the old score to the new position.

Example Video