I've previously written about Alignment and Languages for D&D, and this suggestion is based on that system. All characters in the game world are either Lawful, Neutral or Chaotic - with all the Player Characters being either Lawful or Neutral and the DM controlled NPCs being any of the 3 alignments.
Characters are awarded Experience Points (XP) based on their chosen alignment for their Character. Lawful aligned characters receive XP for defeating Chaotic aligned enemies. They receive no XP for defeating Lawful or Neutral enemies, or for collecting treasure. Neutral aligned characters on the other hand receive 1 XP per Gold Piece of treasure that they return with from their adventures. They receive no XP for defeating enemies.
NPCs controlled by the GM can be motivated by many different things. Some will be more inclined to try and defeat enemies, others will seek out treasure, while some will have different motivations entirely. NPCs do not keep track of XP, and the GM can change their level and statistics when it is deemed appropriate.
When Experience Points are awarded (this could be per session, or per adventure) players decide which alignment their character is after the adventure. This is the alignment they receive XP for, and the alignment that the character will be for the next portion of the campaign (either session or adventure). Most players will keep their character acting within their alignment, but some will be more fickle and change their tactics when presented with large piles of treasure, or the discovery of a chaotic menace that requires a hero's attention.
While players may choose to have their characters change back and forth between Law and Neutrality during a campaign to reflect their changing focus on battling chaos or collecting treasure, they should be aware that some types of classes, spells and magic items work with specific alignments, and that changing a character's alignment to gain more experience for a particular adventure could have some unexpected consequences.
It's possible to expand this system further and allow for additional ways for characters to receive XP based on other factors such as race/class. A Lawful Wizard might gain XP for any magic item discovered, while a Neutral Dwarf might still gain XP for defeating Goblin enemies in addition to collecting treasure. The GM may additionally reward players XP for completing plot points for certain alignments (eg. all Lawful characters may gain XP for saving the Princess) or for certain classes (eg. all Clerics gain XP for making a pilgrimage to a remote shrine). Some exploration type awards may be independent of alignment, class and race entirely (eg. First visit to Gondor / Greyhawk / Waterdeep).
I like the idea of giving players more control over how they seek out Experience Points in the game, and really like making the game mechanics like Alignment more organically reflect how the players are playing their characters.