The short answer was that Sri Ram was focused on his work which included removing Vali, the brute beast like humanity out of the way. He was not keen to have his name counted as a moralist. In doing so he was fulfilling his work and mission to make Aryavarta free of all that would endanger the future of the average human kind evolving towards a sattwic state in course of time. He was also fulfilling his dharma as a friend to whom he had given his promise to help regain his throne.
The longish answer is that he let Sugriva fight Vali and waited until Vali committed the adharma of drawing the energy of the opponent (Sugriva) using his occult capacities. At that point the battle became unequal and he intervened when his friend called in distress after giving his best to defeat the wrong doer and yet failing.
He could have challenged Vali instead of shooting from behind the trees? A challenge between the two would be unequal either ways. None could defeat Vali in hand to hand combat as he had the magical capacity of sucking half the energy of the opponent. And if Rama challenged him to a fight with his bow then Vali would be no match. Shooting arrow from behind the trees was a way of implying that the two sides were yet matched in some way. On one side the impact of the arrow was softened greatly by shooting through the 7 trees. It was a match of strength though on unequal grounds.
Sri Rama himself explained to Vali why he did what he did. It was very simply to uphold the dharma. Vali had lived his life with adharma and to punish the evil doer was more important than anything else.
The spiritual answer of course is that the Divine acts according to another vision and to fulfill the work he has come to do which includes clearing the passage towards the future, paritranaya sadhunam vinashaya ca duskritam. He is not here to satisfy human notions of morality or conform to human ways of thinking and standards of conduct.
Affectionately,
Alok Da