The bulk of the civil service are career hires who are not beholden to the administration. They’re hired on merit, not political loyalty, and they have specific duties to perform. They swear an oath to protect the Constitution, not the President, and there are laws governing their behavior: for example, despite the massive propaganda about wasteful or fraudulent spending, it’s actually a go-to-jail serious crime to spend money for things other than what Congress directed that money to pay for. That’s why it was such a scandal when Trump directed federal spending to his businesses during his first term and that Musk has so many conflicts of interest now because those rules are normally followed carefully. Similarly, when you hear pushback to DOGE demands for access to sensitive materials or systems it’s because the people who operate SCIFs or run those systems have spent their careers being trained on only allowing authorized access and in all previous administrations that followed the statutes and regulations for requesting and approving access based on need, not someone threatening to call an unappointed “advisor” so he can rally a mob on X against you.
A) some are being fired because they did what their bosses asked them to (legally) in the previously administration.
B) some of them are being fired because refusing to do illegal things is considered "disloyal" by the current administration.