They usually do it because there's something they can get from watching others play it that they can't get from playing it themselves. There are a number of forms this can take, and these are just a few examples.
1. Personality. Many of the most popular and successful YouTube personalities that play games and record commentary over them build their brand on their unique personality. One very successful formula is for the player or players to be comedians who use the game more as a stage to set up their unique brand of humor.
2. Mastery. If the person playing it is doing a 100% run or speedrun, is playing competitively, or is just generally known as being very good at that genre of game, watching them play can be interesting because they're playing the game at a very high level of skill, higher than you can personally achieve. A variation on this is educational videos, like how to survive your first night in Minecraft.
3. Discovery. If you don't own the game or don't have access to it, many videos are designed to introduce and review new games to help you to decide if it's worthwhile to purchase the game. Other times it can be fun to watch a person you've been following play new games that you haven't even heard of.
4. New Player Experience. It can be interesting for a skilled player to watch an unskilled player attempting to get the hang of a game. It's hard see a beloved game through "fresh eyes" after you've played it a great deal, and watching someone new play it can bring a fresh perspective other than your own. This can also be a desire to see someone you follow like a game you already like, similar to wanting to introduce a friend to a game or hobby you're enthusiastic about.