I think the Fed hopes that rising interest rates will lead to lower demand, which will moderate (or even reduce) prices, which will make investors less likely to continue to pile in, which will make things more affordable for folks who want to buy a home.
Then, once the Fed feels inflation has been reined in sufficiently, and the economy cools down enough, they'll lower rates, which will make mortgages more affordable.
It's a complex system, and the Fed has only a few tools to affect it, and those tools are more like a sledgehammer than like a scalpel.