> to what purpose was the curfews imposed?
The stated purpose was to flatten the curve.
> Who benefited?
The government.
> How?
By giving the impression that they were doing something.
> Why were the curfews necessary to achieve those goals?
They weren't, as far as we know. In Quebec's case they were still scrambling to justify them a few hours before the press conference:
https://www.thesuburban.com/news/legault-s-curfew-decision-w...
https://www.cbc.ca/news/canada/montreal/curfew-legality-queb...