Why aren't house prices included in CPI? Swedens central bank recently lowered their prime rate to -0.25% from -0.10% in an effort to avoid deflation. 

At the same time, house and apartment prices are higher than ever, up 11% last 12 months, and up hundreds of percents the last 5-10 years. Measures are taken to avoid a housing bubble, like regulations on mortgage payments and so on, these are having an effect but the effects of a rapid rise in rate would be disastrous.

As I've understood, and I guess this might differ from country to country, the measure of inflation, CPI, includes prices for services and goods, but not for houses and apartments, why is that? In Sweden, rent for apartments and the bank rate are included in CPI, but the consumer isn't paying rate, they pay rate * house prices.

If house prices were included in CPI, we would definitely have inflation rather than deflation, so the right action would be to increase the prime rate, which would also lower house prices.
The CPI stands for a Consumer Price Index. As in the price of things that are consumed (at a particular moment in time). Real estate prices are not the price of something consumed because they contain the value of current housing consumption but also the capitalized value of future housing consumption. As such, including house prices would make the CPI a mixture of consumption at different times, and therefore unsuitable for comparing the price of consumption bundles at distinct times. Instead, they use a purer measure of the price of housing consumption: rents. 

Rents reflect the price of consuming a flow of real estate services at a moment in time. Of course, many homes are owned by the occupants and not rented. Therefore, the calculators of national accounts generate something called "owner occupied rents", which is an attempt to calculate what the rents would be on homes that are occupied by their owners. This measure has problems, but for many purposes is quite adequate (Crone, Nakamura, Voith (2004)).