What does it mean by perfect morality? It's said that Sotapanna has perfect morality.

For example, AN 3.85 says:


  "There is the case where a monk is wholly accomplished in virtue, moderately accomplished in concentration, and moderately accomplished in discernment. With reference to the lesser and minor training rules, he falls into offenses and rehabilitates himself. Why is that? Because I have not declared that to be a disqualification in these circumstances. But as for the training rules that are basic to the holy life and proper to the holy life, he is one of permanent virtue, one of steadfast virtue. Having undertaken them, he trains in reference to the training rules. With the wasting away of [the first] three fetters, he is a stream-winner, never again destined for states of woe, certain, headed for self-awakening.


And in AN 9.12:


  Again, Sāriputta, a certain person is complete in virtues, incomplete in concentration and incomplete in wisdom. Destroying three bonds he transmigrates as a human or god the most seven times and makes end of unpleasantness. Sāriputta, this is the eighth person who dies with substratum, released, from hell, from animal birth, from the sphere of ghosts and released from loss and hellish births.


But we do wrong thing from time to time. Our deeds are not perfect. So what does it mean by having a perfect (wholly accomplished) morality/virtue?
In AN 3.88 Buddha gives definitions of the three trainings. Basically, sila is training in discipline (often translated as virtue or morality), samadhi is training in controlling one's mind and mood, and prajna is training in understanding or insight.

In my understanding and as per AN 2.19, training in discipline is first and foremost training to optimize your actions by their result (instead of being simply reactive or impulsive). You do what's wholesome (leads to good results) and abandon what's unwholesome (leads to bad results). You repeatedly train yourself to think objectively in terms of action and its results, not in terms of your personal desires and aversions. For most people this is a radical change in attitude!

However, at this level you do only a minimum amount of self-reflection. Your sole focus is on external activity. But in order to optimize your activity you are forced to suppress some of your baddest impulses, habits and reactions. Which naturally leads to emergence of self-reflection, you becoming self-aware, and going to the next level - training to control your mental and emotional state.

So when Buddha says, "accomplished virtue" - I believe he means that as far as your intention to accomplish the good, you are perfect. Your behavior is fully determined by your good will. However, because of imperfections in your ability to control your mind and emotions, and imperfections in your wisdom/insight into how things work, you may still misstep occasionally.

Notice how Buddha insists in AN 3.85 that to be a Sotapanna you must also be moderately accomplished in concentration, and moderately accomplished in discernment. Not just virtue! This is because virtue, concentration and discernment interpenetrate. You can't have good behavior without some amount of mind-emotion-control and some amount of wisdom.

So in short, in my understanding the perfect morality is wholesome behavior and wholesome speech, based on wholesome intent, based on the right view - the first five and a half steps of the Eightfold Path.

Of course to say that one's behavior can ever be perfect is a (useful) simplification. As Buddha himself says in AN 3.85 you may still "fall into offenses and [later] rehabilitate yourself". But as far as your appreciation of the notion of kusala/akusala and your sincere attempts to act kusala, as far as your attitude - they are perfectly complete. You attitude has been completely reoriented towards the good result. That's what makes you a Sotapanna.