I think Barella is very important to maintain the locker room in a good spirit, he's not selfish, he tries to have everybody on great conditions and sometimes he fights like a true warrior.He did the same thing (along with Mkhi) against Lecce a couple weeks ago, trying to set up Arnautovic for his first league goal with Inter rather than taking a better shot chance himself.
I'm extremely aware of the idea of trying to boost the confidence of your strikers by getting them on the score sheet, but you do that kind of stuff when you're in control of the game. Up 2-3 goals, etc., not when the game is still in the balance. If you can get them the ball in a better position, go ahead, but if you're in the better shooting position, it's not selfish to go for the goal yourself.
But yes, you can't put tour teammate ambitions before the team.
Let's hope he understands, the goal would have been canceled so no consequences here.