Indeed. If more people are willing to pay more money to fly out of EWR than IAD then it makes sense for the company to make that possible. Putting the right plane on each route to maximize profit is what they're paid to do, not putting the best plane on each route for upgrades.
Still, the point remains that if the flights ex-IAD were sufficiently profitable they'd likely still be operating with those aircraft rather than having the swaps made.