The legal enforcement of morality - external behaviour
If one confines morality purely to external behaviour - i.e. to behaviour that can be done whether one thinks one ought to do it or not - then morality can be enforced. For instance, if it is a moral requirement not deliberately to short-change customers, then the law can take effective action against anyone who does this and threaten and practise enough superveillance and apply sufficient penalties to deter anyone who contemplates this form of dishonest behaviour. At least something close to this, and counting as the enforcement of morality, can be done.
In the USA and UK until well into the 20th century gay acts - even 'homosexual conduct' in private - was subject to legal prohibition on moral grounds. Nor was the law inactive. Anti-gay morality was definitely enforceable - and enforced in regard to these 'grossly immoral acts', as the judiciary was apt to call them.
The legal enforcement of morality - internal motivation
However, if one builds into one's understanding of morality the motivation behind behaviour then the enforcement of morality looks far more problematic. The law can through surveillance and prospective penalty stop me from cheating my customers but it cannot make me independently want to deal honestly with them. It can control my actions through coercive incentives or enticing appeal to to self-interest, but it cannot instil the motivation to deal honestly because I think this is the right thing to do. If so, then neither the law nor any other social agency can make me act from a sense of duty, a sense of what I ought to do regardless of the coercive incentives or appeal at play.
In this sense of morality, in which a motivation of duty or obligation in involved, it is impossible to enforce morality.
Enforcement of external behaviour which violates internal motivation
Since this is so, it is hard to be clear how it could be unethical to enforce morality - if it can't be done, it can't be unethical to do it. But perhaps some sense can be given to the notion. It is, within certain limits, unethical to enforce external behaviour which violates people's internal motivation - their sense of right, duty, obligation and conscience. Legislation in the USA and the UK during the two world wars brought in conscription - a non-voluntary legal requirement to serve in the armed forces. Yet there was also a recognition of the legitimacy of conscientious objection. External behaviour which violated internal motivation was possible but was judged unethical.