Not all advantages in chess are material. You may want to trade pieces to gain other sorts of advangages. You're often not really wasting a move, since your oppoenent will also waste one of their own moves to recapture.
Also, the "value of pieces" is an abstraction that may not correspond to what pieces are actually worth in a specific position. For example, after 1.e4 e6 2.d4 d5 3.e5, Black would probably be happy to trade his light-squared bishop for any of White's minor pieces, but he would definitely not trade the f8 bishop for a knight!
In summary, as other answers have already pointed out, trading pieces for the sake of trading pieces is not a good idea. But trading pieces to get some other kind of advantage is a different story