Spain's prime minister said too many foreigners were buying investment homes. But efforts to discouraging them could hit the economy, experts said.