They noted that global warming causes harm beyond provincial boundaries and that it is a matter of national concern under the “peace, order and good government” clause of the Constitution.
Read the Case in Brief at https://www.scc-csc.ca/case-dossier/cb/2021/38663-38781-39116-eng.aspx
For information on the dissenting views of two SCC justices, please see: https://nationalpost.com/news/politics/the-dissenting-view-why-two-scc-justices-say-the-federal-carbon-tax-rewrites-the-rules-of-confederation