The abrupt action reflects the administration’s determination to purge workers it perceives as disloyal to the president.