While it doesn't directly address how to fix this type of problem, I found the book "Moral Man and Immoral Society" to be a helpful discussion of how we make ethical decisions individually vs. in groups (the thesis being justice is nearly impossible to achieve in group actions).