Both teams had already booked last-16 places and Real ended on 15 points from six games, five more than second-placed Inter. Sheriff Tiraspol finished third on seven and drop into the Europa League while Shakhtar Donetsk came last on two.
Real captain Luka Modric, man of the match in his 100th appearance for the club in Europe's premier competition, was delighted they ended the group stage in pole position.
"Very happy about the game and the result. We wanted to finish top in order to avoid stronger teams (in the round of 16)," the 36-year old Croatia playmaker told reporters.
"I feel good, as if I was under 30. My age is not a factor, what matters is how you perform on the pitch. We played well on the counter and Toni scored a great opening goal."
Inter manager Simone Inzaghi rued his team's lack of cutting edge up front and criticised Barella for a rush of blood.
"There are a lot of regrets with the first half because, in my opinion, we played very well and with personality," he said.
"Barella made a serious mistake but the boy is intelligent, he understood the error and has apologised to everybody. When it became ten against eleven it was more difficult."
The fast-paced match produced plenty of thrills with Vinicius Jr firing just wide in the second minute for the home side before Marcelo Brozovic volleyed narrowly over for Inter.
Kroos struck the opener in the 17th minute with a crisp low shot from 20 metres which flashed past goalkeeper Samir Handanovic, the 1,000th goal scored in the European Cup and Champions League by the record 13-times champions.
With the home side moving up a gear, Luka Jovic found the side-netting after a darting run and Rodrygo went close just before the interval when he hit the post.
Barella fired over the bar from 12 metres shortly after the break and Jovic saw his shot from a tight angle parried by Handanovic at the other end before referee Felix Brych showed Barella a straight red card in the 64th minute.
The Italy midfielder retaliated after he rubbed shoulders with Eder Militao by the touchline and crashed into the panel boards, swinging his arm and leg at the Brazilian while he was still on the ground.
Inter were on the back foot and substitute Asensio made it 2-0 with a goal of the highest quality in the 79th minute just after coming on for Rodrygo.
Crisp one-touch passing left the Spanish forward with time and space on the edge of the penalty area to curl a delightful shot into the back of the net off the post.