... he should have been warned first.
Absolutely. And to see this, right on the heels of the Bernal TDF win ("let's give everyone their time at the top of the mountain and this determines the outcome the entire 3 week stage race") really makes me much less of a fan. The person with the fastest time should win. Not the person that the UCI "likes best" that who is "allowed by the UCI" to win. This ain't supposed to be a popularity contest.