A British judge has ruled ethical veganism is a philosophical belief and therefore protected by law.