Spain has refused to allow a ship carrying 27 tonnes worth of explosive material destined for Israel in one of its ports.