Why would a politician sollicit foreign investors to come and buy real estate?
The owners of existing housing certainly benefit from increased demand and higher prices for their assets. The total benefit to society may be positive or negative, depending on whether current owners win more than current non-owners lose (from higher prices if they want to buy and become owners).

Higher price of housing makes new buildings more profitable, benefiting the construction industry.

The politician may favour certain groups over others, for example the construction industry is usually a large donor in election campaigns. So the politician may want real estate prices to rise even if it is on average bad for the country.

`Invest in' need not mean buying existing housing, but it could mean building new buildings and selling the apartments in them. This could increase availability and decrease the price of housing.