It's a cultural thing. In Poland because of the climate, central heating and probably some other habits everyone has a carpet so you take your shoes off because carpets are hard to clean. In Spain because of the climate you don't have carpets because stone floors help cool the apartment down. Bare stone floors are easy to clean and are cold during winter so you keep your shoes on.