The short answer to this question is that we don’t know. Technically, a proton is made up of smaller particles which each have their own charge, but that’s not an answer – we want to know why particles are charged at all. And we don’t know. The universe seems to just be that way.
It’s worth thinking about why we don’t know though.
We can see that electrons repel each other. That’s a measurable fact about the universe, that an electron exerts a force on another electron. However, to make thinking about the physical world easier, we have created a concept called “Charge”. It just makes things simpler if instead of worrying about the fact that electrons repel each other, we say: “Electrons are charged. And charged particles repel each other.”
This then allows you to think about all the sorts of things associated with electrons, such as electric circuits, static electricity, chemical reactions, the electromagnetic spectrum and so on, without having to deal with why it is electrons hate each other so much. The concept of charge is just a model, a shortcut, to help us think. We’re so used to the shortcut (and it helps explain things so well) that we talk about charge as if it were a real thing.
But, something like “Electron-electron hate force” or “Electron-proton love force” would be much more technically correct names.
So why do electrons hate each other?
As I said, we don’t know. We’re also a little stuck on why objects in the universe seem to all like each other a little bit (Hint: We deal with that one by pretending everything has this awesome property called “mass”, and that gravity attracts objects with mass together.) But there are definitely a lot of scientists very interested in working out why these particles exert these forces on each other.