So it isn't that friends suddenly became ex's overnight. It is after coming to the realization that over time they either had sold out their ethics in order to make good money working on cool technology regardless of what it is used for, or that they really bought the indoctrination that what they were doing was important patriotic work. As for the latter, I heard that stuff a lot, and I always thought it was a bad sign that the boss had to kept telling you that you are doing important work. You weren't privy to much beyond your own compartmented subsystem but over time you could eventually piece together the bigger story. As for the former, that's similar to the non-defense world where a lot of smart engineers are developing shady stuff, except that it isn't resuling in thousands of people in far away lands being killed week in and week out as a result.
It's also how we arrive at a common baseline for morality.