I think what you are looking for is called Legal Interpretivism, which, unlike Legal Positivism (which asserts that laws are distinct from morality), asserts that laws are based on morality, and that there is no separation between law and morality, so there must be an interpretation for why such and such is legal or illegal.
In which case, the statement if it is legal then there must be moral reason for it to be legal would hold true, only if you consider an interpretivist point of view.
Interpretation is a kind of moral processing of these norms. To
interpret is to assess the norms constituted by institutional
communication and adjust the set in order to make it more attractive
in some way
That is, to tweak and play with one's understanding of the laws, then interpret those laws in order for them to match some moral preferences, for example: Abortion is legal, and it is totally moral because women are free and have the right to their bodies, and you cannot kill a kid who was never born, so that must be the reason why it is legal.
(and if it is illegal, a legal interpretivist would give a moral reason why it is illegal).
Third, for interpretivism, the justifying role of principles is
fundamental: for any legal right or obligation, some moral principles
ultimately explain how it is that institutional and other nonmoral
considerations have roles as determinants of the right or obligation.
In the order of explanation, morality comes first.
Of course there are other points which set Legal Interpretivism apart from Legal Positivism and Natural Law Theory...etc.
Caveat: Is it an appeal to authority (law) fallacy?
It is important to know when we say that such and such is a fallacy. A statement or assertion cannot be a fallacy, if I say: If x is legal then x is Moral, this is a claim, not a fallacy.
That is, I claim that such and such is the case, that it matches some state of affairs in the actual world.
And when arguing with others, I can use that statement as a premise. And the other party can check whether my argument is valid or not.
- Premise 1: For all x, If x is legal then x must be moral
- Premise 2: Abortion is legal.
- Conclusion: therefore, Abortion must be moral.
The other party would not argue about the validity of the argument, that argument is certainly valid and not fallacious.
What remains is whether the other party accepts the premises as true.
Whether they do or do not accept the first premise is not a fallacy, you believe that the conditional is true and they believe it is false. In either case, the one who accepts the first conditional as true is a Legal Interpretivist.
But suppose two people are involved in a serious discussion about the subject, not just formal deductive arguments:
- A: Abortion is moral.
- B: Can you give me a good inductive or deductive argument as to why you think so?
- A: Because the law says so, and you have to accept it.
- B: mmm... okay!
Here, this is an informal fallacy (Appeal to the authority of the law), simply because A did not state the reason why they think so.
It is a fallacy A did not take much time to formulate an argument and ask whether B agrees with the premises or not, they just presuppose that the fact that Law says so then B must also agree with it, which is an appeal to authority.