Salaries don't necessarily rise at the same rate as inflation. If they did, there would be 0% real growth in the economy. Inflation is usually measured by watching the prices of a basket of goods: if those goods' prices increased by 5%, then inflation is 5% (in reality it can be more complex than this).
Inflation isn't a "real" metric in the sense that it affects all things equally. Housing prices could increase by 50% but the price of a gallon of oil or a bar of soap could decrease by 10%.
You are confusing “salaries” with “output”; salaries (or even domestic incomes in total, which involves more than salaries) growing at the rate of inflation can occur with negative or positive real growth. Zero real growth means output growing at the rate of inflation. (National economies aren't closed systems, and some output may produce foreign rather than domestic income, as in returns to overseas investors.)
The % of salary people devote to housing shouldn't increase by a large amount each year.
And people's salaries don't rise that much year to year either. It rises the same rate as inflation.