Wall Street owns the company, and can set its direction. Apple isn't some hobby business, under the control of a principled founder. Particular people in the organization will push back against such measures, but whether or not they will win is crapshoot.
Building weapons wasn't in Google's DNA either, yet Maven happened. It was only shut down because the pushback succeeded. Its success was not a sure thing.
Corporations aren't people - the only principles or ethical compasses they follow are those of their employees. Employees come and go, and, in the case of leadership, can be fired by the owners.
There's a long history of tech companies that have done a 180, in terms of their DNA. Microsoft, SUN (Having been bought by Oracle), Google, are some of the more prominent ones.