If electrons can be created and destroyed, then why can't charges be created or destroyed? I read on Wikipedia that electrons can be created through beta decay of radioactive isotopes and in high-energy collisions, for instance when cosmic rays enter the atmosphere. Also, that they can be destroyed using pair annihilation.
We also know that charge is a physical property which can be associated with electrons.
My question is why can't charges be created or destroyed if electrons can?
 A: Electrons can only be created and destroyed in processes that keep electric charge constant.
There are three Standard Model interactions involving the electron: $\rm W^-\to e^-\bar{\nu}_e$ and $\rm \gamma\text{ (or Z)}\to e^-e^+$.$^1$ the first case, the W boson has the same charge as the electron, so no charge is created or destroyed. In the other cases, a neutral particle turns into two particles with equal and opposite charge. Again, no charge is created or destroyed.
In a certain sense, there's no reason that electric charge, in particular, has to be conserved- our theories start with the fact that that charge cannot be created or destroyed as an assumption because we have never seen it be created or destroyed, and the universe as a whole appears to be electrically neutral.
$\scriptsize^1\text{Also technically }{\rm H\to e^-e^+}\text{, but that coupling is very small and for practical purposes it can be ignored.}$
A: When a particle is created or destroyed, energy is conserved. Energy is also a property of an electron, but we are not inclined to ask - why is energy conserved when the particle is not, because we accept the principle that the energy is, in a sense, temporarily imbued in the particle, but is otherwise independent of it. In the same way, charge is not only a property of an electron, but of multiple other particles as well. The idea is similar in the sense that we say that only processes that conserve the total energy can occur, and only processes that conserve the total charge can occur.
Ultimately, the point is that the charge is not fundamentally attached to an electron, but can be carried away by another particle, or canceled out by an opposite charge.
An important aside is that charge conservation in quantum theory comes from the gauge invariance associated with the principle that a global change in phase has no observational consequence.
A: The answer is related to conservation laws. In physics, processes can only happen if they respect certain conservation laws.
The creation and destruction of electrons does not break any conservation laws; namely the energy is always conserved and transformed to another form when electrons are destroyed or created. However, the creation or destruction of charges does break a conservation law $-$ the conservation of electric charge.
A: It’s important to note that electrons can only be created and destroyed in interactions which respect the fundamental symmetries of nature and their associated conservation laws.
So, charge conservation is one such conservation law; “number-of-electrons conservation” is not. (Though before radioactivity was discovered, you wouldn’t be unreasonable to think so!) Since other things, like protons, can also carry charge, it’s possible for a given interaction, such as beta decay, to create a (negatively charged) electron while still conserving the total charge—for example, by creating a (positively charged) proton at exactly the same time.
Technically, when a neutron decays in beta decay, the proton is created at the same time as a negatively charged $W^-$ boson—and then the boson decays to an electron and a neutrino (0 charge). But again, in each of these changes, the total quantity of charge is conserved.
And just to clarify: often you’ll hear the terminology “charges” to simply refer to particles that have some nonzero charge. But note that while the particles themselves might be created and destroyed, charge as a quantity is always conserved! And since it’s the quantity we care about, not the particles, we might conserve the quantity by creating two oppositely charged particles, such as the proton and electron in beta decay. In some sense, then we’ve created charges (particles with charge), but have not created any charge—at least, not when we add it all up and calculate the overall quantity of charge, which is still 0, just as it was before the decay.
A: So the mechanisms which generate and destroy electrons happen to be such that they never violate charge conservation.
Let's take pair annihilation for example, an electron and a positron meet and they become two photons. Before, the total charge is zero: the positron has positive charge and the electron has the exact opposite negative charge. Afterward, the total charge is zero, because photons don't have electric charge.
You also mentioned beta decay. Beta decay happens when a nucleus has too many neutrons. If it has more neutrons then it can stably hold then one of those neutrons can turn into a proton plus an electron plus an electron antineutrino. Before, the total charge was zero: a neutron has no charge. After, the total charge was also zero: the proton and the electron balance each other out while the antineutrino has no charge. And there is a reason that we call it an antineutrino because by thinking of it as an “anti-lepton” we can derive a different set of numbers which are also conserved: both the proton and the neutron have three quarks so the number of quarks is conserved, and also if we say that an electron is one lepton and the antineutrino is minus one lepton, then the lepton number is also zero both before and after.
Interestingly, right now we usually don't describe electric charge as the most fundamental quantity. Since the 60s we have had an electroweak theory which unites the electromagnetic field with the weak nuclear force. According to this there are two more fundamental charges, called weak hypercharge and weak isospin. However according to this theory there is a field which it took a very long time to measure, called the Higgs field, which in some sense distorted these two but did not distort a certain sum of them. And that sum that makes it through these interactions with the Higgs field unchanged, is what we call electric field, connecting to the force particle which makes it through these interactions with the Higgs field unchanged, which is the photon, the only of these particles to remain massless and thereby describe a force of infinite range.
This is all the way of saying, while the conservation of electric charge certainly constrains the theories that we make, we don't just make the theories by building electric charge into the theory directly anymore; with the discovery of the Higgs boson, it turns out to be a small part of a bigger unified force.
A: Feynman once asked more or less the same question (page 129 of "Quantum Field Theory" by Lewis H. Ryder):

I remember that when someone had started to teach me about creation and annihilation operators, that this operator creates an electron, I said 'How do you create an electron? It disagrees with conservation of charge'. - R. P. Feynman

So you are good company. I think by now it has become clear to you that whenever an electron appears it must take its charge from other charged particles. An electron can never be created on its own. Or it takes its charge from other particles, or a positron is created at the same time.
Likewise, an electron can't be destroyed without another equally, but oppositely, charged particle being created. When the electron is isolated, it can never be destroyed.
Charges can be created, like the charges of an electron and a positron in pair production, but their total value must always be zero (i.e., total charge can't be created).
A: Charges can be created and destroyed. Total charge cannot.
Whenever you create an electron, charge $-1$, you must also create a positron, charge $+1$. That gives total charge $0$.
Whenever you create a proton, charge $+1$, you have to create an anti-proton, charge $-1$. That gives total charge $0$.
As far as we're aware, the total charge in the Universe is zero. Every proton's positive charge is balanced by an electron's negative charge.
That said, there's a caveat to the above: the rules as I've described them have it that at any time you make matter, you also make anti-matter, which is more than just opposite charge: if they were strictly followed, we'd not be here, because all the matter and antimatter would have reannihilated into photons. The reason for it to be otherwise is not known. However, presumably it would not involve any processes breaching charge conservation. For example, it might be possible to convert anti-protons into neutrons and electrons. This would not violate charge conservation. Total charge $-1$ first, then $0$ and $-1$ as components - total, $-1$. That's one way it could happen. Other ways could work, too.
(Why do we presume that charge conservation cannot be violated? Simple: it's the easiest way to explain why the total charge of the whole Universe is zero.)
A: Well most of what needs to be said already has been said. But there is something else that I think would interest you.
Charge in a system is only conserved when a very specific symmetry in the system in not broken. Noether's theorem links symmetry to conservation laws. If you can find a way to break the symmetry that governs conservation of charge, then that conservation law will not hold.
An example of this would be introducing an external force in a system, thus breaking the symmetry that govern conservation of linear momentum.
Electrons can be created and destroyed because the process does not violate any of the given system's conservation laws. If you can find a situation in which the symmetry governing conservation of charge is broken, you shouldn't have much problem creating or destroying charge.
