To learn more about the story behind the story here are some sources (note for the explicit story of the killed boy there are many different versions on how he was killed Imam al-Qurtoby in his tafsir said one could bring them together):
So the point is that Moses or Musa (Peace be upon him), was asked
"Who is the most learned person among the people?"
'O Allah's Messenger (ﷺ)! Is there anyone on the earth who is more learned than you?'
And he answered with "No" and
"So Allah admonished him (Moses), for he did not ascribe all knowledge to Allah. It was said, (on behalf of Allah), 'Yes, (there is a slave of ours who knows more than you ).' Moses said, 'O my Lord! Where is he?' Allah said, 'At the junction of the two seas.'"
The point is that in the whole story Moses is judging the apparent6ly criminal or sinful acts of al-Khidr according the shari'a he was sent with and teaching, while al-Khidr had been given knowledge (maybe knowledge of future or unseen etc.) from Allah which Moses didn't know about:
When Moses greeted, he uncovered his face and said astonishingly, 'Is there such a greeting in my land? Who are you?' Moses said, 'I am Moses.' Al- Khadir said, 'Are you the Moses of Bani Israel?' Moses said, 'Yes.' Al-Khadir said, "What do you want?' Moses said, ' I came to you so that you may teach me of the truth which you were taught.' Al- Khadir said, 'Is it not sufficient for you that the Torah is in your hands and the Divine Inspiration comes to you, O Moses? Verily, I have a knowledge that you ought not learn, and you have a knowledge which I ought not learn.'
Moses needed to promise to be patient and not to ask about anything al-Khidr does until he would reveal it to him. This was the condition for Moses to follow and learn about this knowledge, as we read in the story it was a very big challenge for Moses and would be for any of us I assume!
About the reaction of Moses to the killing of the boy scholars have different interpretations: some say that in this case this was a clear killing so the refutation here using the word نكرا is more emphasized than in the case of the refutation for the sinking of the ship which was an act to prevent something bad in the future by using the word إمرا. Some said it's the total opposite as in this case it was a killing of one in contrast to a possible killing of many people. Quoting ibn 'Atiya Imam al Qurtoby said in his tafsir that إمرا is a more emphasized refutation of an upcoming injustice while نكرا is related to a decay that already happened. While sheikh Taher Benachour in his tahrir wa-tanwir affirms the first view of the refutation for a killing being more emphasized, this is also the opinion of ibn Kathir and at-Tabari in their tafsir.
So no Moses never toke any of these "acts" easy or lightly, but the point is that he made a promise -and Muslims or Believers must keep their promises or covenants one could say no matter what (see for example 3:76, 6:152, 9:4, 13:20, 16:91, 16:95 and 17:34 - and was keen to keep it, but he couldn't but react with a kind of refutation which he exclaimed with his words, as he couldn't just stay and watch, I think any of us would have done the same!
And Allah knows best!