WBL and standard treasure rewards are a guideline, not a hard and fast rule
As long as it balances out over time, it's fine to give a lot of 'loot' from defeating, say, a well-geared npc and then no loot when a wild beast ambushes the party as they descend into the depths of the volcanic furnace known as 'Angstraanggrad' by the dwarves.
Secondly, how you give out the loot depends on the GM. Either as unrelated to the combat treasure - the contents of someone's wallet, say, treasure being used in combat - such as the masterwork rapiers the street duellists were equipped with when the party defeated them, 'hidden' treasure that is not immediately obvious and needs to be found, a payment given by someone for the task the party did (either offered upfront, or given as a gift or reward afterwards), or even unrelated circumstance - a party member could inherit, the party could earn wages for a long sea voyage where they worked as crew, they could even make a shrewd business deal.
The purpose of the wealth-by-level system is to indicate a level of power in magic items that is appropriate for each level of power in class levels - so the party doesn't get so 'blinged out' that their classes no longer matter, but also so they have the magical gear the game expects them to have to fight tougher foes.
As such, if the party spends gold on charity, parties, buying real-estate, building small private armies (of non-CR appropriate soldiers, that is), you can increase the amount of treasure they are able to acquire by roughly that amount (although obviously, not immediately, as you don't want these things to feel 'free' and therefore worthless).