Loyalty is actually a reasonable expectation for a cabinet position. Remember, these people aren't elected, the POTUS is. If the appointed official's priorities conflict with the POTUS's he/she should be fired. In this case, where we actually had bureaucratic scumbags abusing their power to attack the POTUS, the AG absolutely owed his loyalty to the POTUS, and he had a duty under the law to put the brakes on the meritless investigation. But Sessions was a weak AG who didn't have the backbone to stand up against entrenched institutional power of unelected bureaucrats. Barr is thankfully much better.
If Trump fires Wray, as he should, hopefully Trump finds someone to replace him who is from a different circle than the cockroaches that infested the DOJ/FBI under Lynch/Comey. At this point, he has a much better understanding of why that position is so important.