Being vegetarian tells you what people don’t eat, not the reasons why they do not eat it, someone could be vegetarian because they don’t like meat, while someone else has a deep philosophical commitment to not harming other.
For example, Jainism centers around the belief that to harm others is to harm the self and that include all others. So it’s the killing and harming of animals that matters not the eating as such. Some Jain monks are known to sweep the ground before their feet to avoid stepping on insects.
There are a lot of accounts of why you might not want to harm other sentient beings, the most influential in the vegetarian/vegan movement has been Peter Singer’s equal consideration of interests principle. Beings matter not because of their species (Christian view of special nature of humans because they have a soul, animals put on earth to benefit us), but because they have interests. Any interest counts equally, so one ‘unit’ of pain felt by a slug counts as much as one ‘unit’ of pain felt by a human. Some beings, e.g. humans, great apes, dolphins, etc, May have more complex interests such as the need for social interaction and extended familial relationships, so may overall outweigh other interests, e.g. the mosquito’s interest not to be killed.