It's just money in general. Not every province tracks foreign ownership of residential housing, but those that do show only about 5% of houses are owned by foreigners. It's mostly rich Canadians and Canadian businesses that have purchased a huge amount of housing as a form of market speculation.
However, houses being worth a small fortune is good for anyone who already owns a house, which is most Canadians. The issue is that not everyone wants house prices to drop.
This is one of many pieces of the puzzle. There are also terrible zoning laws preventing density in cities. Also, to be clear, immigration is essential to our country and we have a responsibility as a wealthy western to country to accept refugees. However, we have been increasing our immigration rates a ton and our new builds has been really low. Many of these new Canadians are sold a false promise.
Housing is a main factor to Canada's GDP which is scary, so the government is propping it up.