Such positions are considered constituionally exempt from civil service protections. Unfortunately, for decades, Democratic administrations adopted orders and rules that protected those positions and installed their political loyalists in essential roles in the bureaucracy. The result was that many Republicans were blocked from carrying out their promises and their Administration's political program.
Why not just abolish such jobs? They are needed to formulate and carry out policy implementation and make the bureaucracy work. Otherwise, the job of Cabinet secretary becomes that of a time server who delivers speeches but wonders what is going on in his agency and what is in all those papers he has to sign every day.