Ignoring whether I agree or not with the order, firing the AAG made sense. Here's why:
#1 - The AG is THE person to defend the administration in court, and even argues personally on behalf of administrations in front of the Supreme Court. Her duty is to defend the Administration's position (even if she personally disagrees with it). As wikipedia puts it (abbreviated for space here): "The United States Attorney General (A.G.) .... is the chief law enforcement officer and chief lawyer of the United States government." But I suggest reading here for a very good overview: https://www.justice.gov/about
#1a (to highlight this specifically: AGs determine whether to prosecute, not whether to defend.
#2 - The courtroom is the place to determine if the order is legal or not. From what I understand, Congress can also override this.
#3 - There is no (publicly known) communication between the AAG and the President regarding her stance. From what I can tell, she contradicted his order without informing him. Note that he has no legal requirement to inform her, but she does to inform him (being that the President is the superior to an AG).
#4 - Presidents have the right to fire US Attorneys without any reason. And they use it often. Every President in recent memory has done so.
#5 - The order affected non-citizens who are outside the country. The law and legal cases tend to give wide latitude to the executive branch on actions outside the country.
Again, I say this regardless of whether or not I like the order. I will say this - at a minimum, he should have consulted with someone to minimize some of the issues that this order faces. That fact that he apparently did not even do that is astonishing.