Why do points matter in trading pieces? I am a beginner in chess and I am following the tutorials on Chess.com and reading The Complete Idiot's Guide to Chess. In the tutorials about capturing pieces, it is common to count the points in trading pieces. 

For example, say I can capture a rook with my knight and the knight will also be captured by my opponent. In that case, because the rook is worth 5 points and my knight is worth 3 points, I will gain 2 points. In most of the tutorials I use, this kind of play is advised.

I am wondering why points matter in trading pieces. Does the fact that the knight is worth 2 less points than the rook make it less valuable?
The point system in chess gives a rough indication of how strong each piece is. So the short answer to your question is, yes, a rook is more valuable than a knight, and so in the vast majority of cases, if you can trade a rook for a knight, you should do it.

This does beg the question, however, about why a rook is considered more valuable. At its best, a rook can control long files (columns) and ranks (rows). While the knight's tricky movement can sometimes be an advantage, in general we consider it to be inferior. One way to demonstrate the value of a rook is to try the rook and king vs king endgame. (I would definitely recommend looking it up first.) Note that there is no way of checkmating just with a knight and king. In fact, the game would  be drawn by insufficient material. This is just a fancy way of saying that neither player has enough firepower to achieve checkmate. As you progress, it will become clearer to you why rooks are more valuable than knights. At some point, you might even be able to notice when a knight is better than a rook! But for now, concentrate on the points system—it's a great way of knowing who is ahead in the game.

Edit: it's worth noting that the points system is not part of the rules of chess. The bottom line is that you are trying to checkmate your opponent's king. But having more material (i.e. points) is a key way of getting closer to this goal.