D&D is not built for nonviolent solutions. You lose out on treasure, and you may even lose out on XP if your DM is vicious.

It's just part of the "adventure, fighting, experience, and treasure" paradigm. Many games don't have anything to do with that one, but it's pretty much built into D&D. You can play a campaign where combat XP and looting treasure aren't a big factor, but that's going to be very different from the default and standard.