Because some people find it fun to mess around with them. Also, sometimes it's helpful when your fustrated with a game and just want to progress forward, though I doubt that's why cheats are left in the first place. I admit to using cheats but it's my enjoyment that counts for me, not if I can impress others with my gaming skills.
Also, now some games "punish" you for cheating. In Red Dead Redemption, if you cheat you can't save your game or get achivements. Saints Row 2 prevents you from getting achivements and it marks your game to state you've cheated, like a bad boy.
In fact, I would say that cheats in games has drastically fallen since the 8-bit, 16-bit and 32-bit era, which not saw lots of games have cheats (whenever via commands or passwords) but devices such as Game Genie, Action Replay and CodeShark were widely avilable for you to "hack" your games to give you infinite lives, infinite health, etc. (of course, you could a few times find codes in those devices to make games harder).
PC games are where you'll find the most cheats, especially Western RPG's, even today.
If you don't like cheats, don't use them. Sure developers could leave them out but if they leave them in, it's not like they are forcing you to use them. If you give in, use them and than complain they make the game "boring" then you only have yourself to blame. As ThravRande points out, cheats can be used to create some wicked fun.