Undead enemies probably had money before they died. Everything else has money because "OOH SHINY" and because logic is a fickle thing in the game.