It’s a policy matter, not a legal matter. The USG is the client and decides what position it wishes to hold. The lawyer can provide legal advice, but the client decides what position it wants its lawyer to take. If this story is correct, which I doubt, Barr should not be involved in election strategy.
So the Administration going before the Supreme Court is not a legal matter. Good to know. And it absolutely the job of the AG to advise Trump in matters going before the court. Nothing says Trump has to accept that advise. But the AG would be remiss if he did not give Trump a full view of the pros and cons of such pleadings.
Barr was confirmed by the Senate to do the bidding of the GOPe and the donor class. The GOPe loves socialized medicine. Big government programs to manage and corporations get employee health care off their books. The GOP have fought tooth and nail to keep obamacare the law of the land.