Spanish basketball teams have chosen to play their home games against Israeli opponents behind closed doors because of the threat of pro-Palestinian protests.