I am not sure anybody ever tried to justify it directly but it's reasonably easy to explain how a situation like this could arise.
Scotland is able to set the rules for Scottish universities. It can't force English universities to forgo tuition fees and could not possibly fund all universities in the UK or change the rules governing higher education in the whole UK.
Another factor is that the number of (potential or actual) EU students at Scottish universities is likely to be (much) smaller than that of English students. So the risk that the latter group strains and destabilizes the system is much higher and it is not too difficult to justify the way English students are treated.
On the other hand, there are a few subtleties in the rules but in general, it does not seem too difficult to justify the way EU students are treated either. The basic principles here are reciprocity and non-discrimination.
Thanks to the role of the English language in the world and the general lack of interest for foreign languages in the UK, I would guess there are more people willing to study in the UK than there are British or Scottish students registering in France, Germany, etc. but British citizens can also study everywhere in the EU on a par with locals, which usually means with very low or no tuition fees.
The result is that EU students potentially pay less than English students at Scottish universities but that's mostly a side effect of the two logics I just described. This sort of discrimination against residents of England is possible under EU law because it is an internal matter for the UK (it's the result of EU restraint, not of EU overreach, if you will).
Incidentally, EU students who follow a full course of study at an English university do have to pay tuition fees but have access to the same student loans than British students. Here again, the rule is simple and does not seem too difficult to justify: The UK is free to do what it wants (subsidized education, tuition fees, student loans, etc.) but it has to treat EU and local students in the same way.
Finally, your question focuses on EU students but other EU countries do not discriminate against British students. By contrast, the role of Scottish MPs in the introduction of something they knew would not impact their constituents seems much harder to justify.