Yes, to give you the irits.
Crits have lots of niggle in them. If someone dun like you you'll sure find out about it.
Pushing you out is a common way of testing someone's nerve, very important in a tight sprint situation. If you let him push in he'll have you figured as a wallflower in a bunch sprint and will have no qualms pushing you out of the paceline if he wants/needs to.
By slowing down the guy was doing his best to get you to sap the energy out of your own legs. Enduro guys try every trick in the book to wear out the sprinters. It mostly boils down to lotsa hard accelerations or keeping the pace very high at the end of the race. By slowing down in front of you he was making you accelerate often, removing punch from your sprint.
Squeezing you out on a high speed technical corner is also a fave move of the experienced guys. It's all very safe if you both hold your line and don't tangle handlebars, but it's meant to put you off your game and out of contention.