1. Jake Allen signed his extension on October 1, 2022, so I have no idea why you think what Allen did last season is relevant to why his contract was offered.
2. Last season Allen had a GSAA/60 of -0.047 (which is along the lines of Hill, Thompson, Grubauer, Talbot, Markstrom, Jarry and Anderson). He's a mediocre veteran goalie that generally doesn't cost his team games and strangely has a history of elevating his game in meaningful moments (in the small sample where he's in that position) and those can be costly in free agency.
3. Montembault was truly awful in 21-22, and management wanted a goalie that wouldn't make the forwards/D-men be nervous to take chances in the neutral zone and offensive zone.
Its also fine if Montreal doesn't trade or buyout Allen, he's still a capable goalie and Montreal doesn't need the cap space for the next two seasons anyways.