Burning a lean mixture causes high combustion chamber temperatures, which is good for efficiency, but NOx is created at high temps. Its just a side effect of lean burning.
Here is a general chart made by Toyota that shows how emissions change based on air fuel ratio: