Not all retention is created equally.
When you are retaining because the other team doesn't really have much cap space, you get paid for doing it because you are enormously benefiting the acquiring team by making the player fit into the salary structure.
Then there is retention because the player isn't worth their contract, and therefore you retain so the player has a contract that is palatable and makes them a moveable asset.
In the case of Allen, I think it's more column B than column A, and therefore the Canadiens wouldn't get "paid" to retain on Allen, they would be doing it so he would become tradeable.