Googled it because I hadn’t really questioned it, answer from Reddit (and Wikipedia):
Most large airports in Canada have codes that begin with the letter “Y”, although not all “Y” codes are Canadian (for example, YUM for Yuma, Arizona) and not all Canadian airports start with the letter “Y” (for example ZBF for Bathurst, New Brunswick). Many Canadian airports have a code that starts with W, X or Z, but none of these are major airports. When the Canadian transcontinental railways were built, each station was assigned its own two letter Morse code. VR was Vancouver, TZ Toronto, QB Quebec, WG Winnipeg, SJ St. Johns, YC Calgary, OW Ottawa, EG Edmonton, etc. When the Canadian government established airports, it used the existing railway codes for them as well. If the airport had a weather station, authorities added a “Y” to the front of the code, meaning “Yes” to indicate it had a weather station, or some other letter to indicate it did not. When international codes were created in cooperation with the United States, because “Y” was seldom used in the US, Canada simply used the weather station codes for its airports, changing the “Y” to a “Z” if it conflicted with an airport code already in use. The result is that most major Canadian airport codes start with “Y” followed by two letters in the city’s name: YOW for Ottawa, YWG for Winnipeg, YYC for Calgary, and YVR for Vancouver, whereas other Canadian airports append the two letter code of the radio beacons that were the closest to the actual airport, such as YQX in Gander and YXS in Prince George.
Four of the ten provincial capital airports in Canada have ended up with codes beginning with YY, including YYZ for Toronto, Ontario, YYJ for Victoria, British Columbia, YYT for St. John’s, Newfoundland, and YYG for Charlottetown, Prince Edward Island. Canada’s largest airport is YYZ for Toronto–Pearson (YTZ was used for Toronto City Airport, so YYZ is the station code for a village called Malton, which is where Toronto Pearson International Airport is actually located). YUL is used for Montréal–Trudeau (UL was the ID code for beacon in the city of Kirkland, now the location of Montréal–Trudeau). While these codes make it difficult for the public to associate them with a particular Canadian city, some codes have become popular in usage despite their cryptic nature, particularly at the largest airports. Toronto’s YYZ code has entered pop culture in the form of a popular rock song utilizing the “YYZ” Morse code signal. Some airports have started using their IATA codes as marketing brands. Calgary International Airport has begun using its airport code YYC as a marketing brand and name for the airport authority web site (yyc.com),[4] while Vancouver International Airport advertises as YVR (yvr.com).