Perhaps the reason Alakazam dosen't get thunderbolt is due to its spoons being very good conductors, and thus harm Alakazam when it uses it?
In cases like this it's usually better to figure out why these Pokemon learn the odd moves they do than the move they don't. All these Pokemon are non-Electric-types so it makes sense they normally don't learn Electric moves because they can't generate electricity. So with that said:
Abra family: Should be noted Abra can learn Charge Beam (and Shockwave in Gen III & IV) too, so it has nothing to do with the spoons. For Charge Beam its description is "The user fires a concentrated bundle of electricity", so could be that the Abra family has to use its psychic powers to "physically" gather up the ions in the air until it has gathered enough to unleash it. Shockwave, also a weak Electric-type move, could be the same way but instead just a different way of unleashing it. This explanation can also go for Thunder Wave. Finally it knows Thunder Punch by gathering the ions around its fist.
Espeon: Um, Espeon can't learn Charge Beam. It could learn Zap Cannon in Gen II (as well as the Abra family). As for how, Espeon uses its tail to sense movement in the air, so it can probably also sense charges ions in the air and, like the Abra family, use its psychic powers to physically gather the ions together. Now while Zap Cannon is powerful, it's a 50/50 change it'll hit so it (and the Abra family) can gather a lot more electricity but aren't able to properly aim it.
Delphox: Delphox is the one that honestly surprises me as it's a mage! *Sigh* So why only Shockwave? Well it's obviously better in controlling fire with its wand and maybe the only way it can capture ions is twirling its wand around, having no control where the electricity will exactly shoot out as a bundle so instead sends it out all around it.
Hatterene: It getting Nuzzle makes sense with its lore not liking strong emotions: if you try to hug it it'll paralyze you. Also G-Hatterene's Dex describes G-Max Smite as "
Beams like lightning shoot down from its tentacles"; it looks like lightning but that's just how the form the energy from the move is released, it's not actual electricity.
Psychic-type Pokémon and Electric-type moves have really weird interactions. Like Reuniclus being able to learn Thunder, Thunder Wave and Thunder Punch, but not Thunderbolt. An incredibly powerful, but uncontrolled and inaccurate electric discharge (Thunder) is okay, but a weaker, controlled and accurate discharge (Thunderbolt) is not.
Could there be some sort of underlying explanation behind the low amount of overlap between them? I mean, in eight generations we only have one Electric/Psychic-type Pokémon (not counting the UFO from Pokéstar).
Not an Electric-type so can't focus a lightning bolt. Being the cell division Pokemon, it probably can generate electricity via nerve cells communicating with each other thus able to use the stronger Thunder but once it leaves its body the electricity isn't controlled.
My guess the reason there hasn't been Psychic/Electric is because there is a bit of a conflict between the aesthetics: Psychic has been presented as a more "focused/concentrating" Type while Electric is a Type which sends out electrical bolts quickly. While it's certainly a cool Type combination and you can probably create a cool concept from it (like I'm thinking psychic bound lightning whips), it would possibly be a far-out design.
/
-- Isn't the entire point of these two that they're water pollution / sludge? That seems far too soft to dig a hole with, even though it has hands. Perhaps it's a reference to how sludge slowly seeps into the ground, but to my knowledge it doesn't really resurface by itself.
/
-- They're both Flying-Type and have boxing gloves-like hands. I feel like digging a hole with boxing gloves would be hard.
-- I didn't include Cyndaquil because it's based on a burrower irl, but Swinub isn't so what gives? Piloswine can burrow with its tusks if it really wants to, but Swinub has nothing to dig with at all. This is the only Pokémon on the list to use the move in the anime too, and it for real just jumps into the ground head-first and disappears beneath it somehow. Like Wooper, it's Ground-Type for mud-based attacks and general terra magic, I don't see the digging here.
/
-- Not levitating or Flying-Type, but what can it dig with? Coral often lays on the ocean floor, but not beneath it.
-- I feel like digging a hole with boxing gloves would be hard v.2.0. Hariyama also looks like it struggles to touch its toes, but I guess if it lay on the ground and used only one arm it could manage it so it only gets an honourable mention, but then I question why mons like Snorlax don't learn it.
/
-- I said that I wouldn't include Pokémon whose prevos can use it just fine while they can't, but these two are a special case because as of Gen VIII only they learn it at Level 1. Similarly to Gligar, Ninjask at least has digging utensils, but Shedinja has no way to do so and constantly levitates. I guess it fits into the ninja motif of disappearing and reappearing, but they had a great opportunity here to give each stage of the family a unique semi-invulnerable turn move to fit with their differences. Nincada learns Dig at level 1, while Ninjask learns Fly and Shedinja learns Phantom Force. That would've been cool. BTW, Nincada only learns Dig at level 40 unless you use a TM, meaning Shedinja and Ninjask can learn it 20 levels earlier than it.
/
-- Another Ground-Type to make the list, but really what could it dig with? Its snout? These two are more terra magic / volcano dudes than burrowers. Though I'd like to see a camel try and dig a hole. If "magma lies underground so it counts" worked, then Magcargo and Slugma would also be able to learn Dig.
/
-- These two are actually in the same boat where as of Gen VIII only they also learn Dig at level 1. Why? Vibrava especially has nothing to dig with, and while I suppose Flygon believably can, it's through using its stubby little arms only.
/
-- I don't really understand this for either of them. I suppose the bottom of Baltoy could be used as a drill?
-- I feel like digging a hole with boxing gloves would be hard v.3.0. Technically they're as hard as rock so it's more forgivable, but scraping a totally round rock into the ground to dig a hole wears the rock away more than the ground. Notably, Registeel can't learn the move even though it could probably perform it easier.
/
-- Digging a hole with a beak would probably take 5 turns. Those flippers don't offer much assistance. Empoleon has a trident it can use to dig with, though.
/
-- These two I'm a little less sure about because they probably could burrow with their feet as they're clawed, but I'm including them because for a biped that seems insanely impractical. Also they're T-Rexes with cute lil stubby arms that definitely can't reach the ground unless they faceplant while digging.
/
-- I'm surprised at their inclusion, but these two learning it via level up is odd considering they really have nothing to dig with either. Their whole shtick is more so being the ground rather than digging beneath it. They also only got the move in HGSS, so when they were first introduced it seems the devs agreed.
/
-- Poor guy, it has no hands haha v.6.0. Bonsly would definitely also cry when asked to dig. I feel like digging a hole with boxing gloves would be hard v.4.0. Sudowoodo has ball-hands that seem hard to dig with, but they're at least as hard as rock so like Regirock it's feasible, just really impractical, and would likely result in more damage to Sudowoodo than the ground itself.
-- Poor guy, it has no hands haha v.7.0. Notably, the other two Wormadam formes (nor Burmy) learn the move, only Wormadam-Sandy. It is Ground-Type, but there's still nothing for it to dig with. The rocks right on the top of it? They're not even limbs.
-- Poor guy, it has no hands haha v.8.0. Like Wooper and Swinub, this is Ground-Type because of mud-based attacks and other general terra magic, as opposed to being a burrower. There's really no way it can dig.
-- The entire purpose of these Pokémon is to lay in wait of prey on the ground, not beneath it. Stunfisk has nothing to dig with at all since every edge seems rounded, while Stunfisk-Galar probably can dig with its sharp metal parts but it would require exposing its underbelly as it does so, which is a weak spot. When you're already flat, going underground doesn't seem to offer much utility.
/
-- Poor guy, it has no hands haha v.8.0 and v.9.0. These two are based on coal, which obviously is mined underground. But I don't think the coal's underground because it dug down there itself, right? As a reach, when you drive your car off-road in somewhere like mud, it can dig a couple of cms underground and get stuck. But that really is a reach.
Grimer/Muk: It's body is probably just as acidic as it is poisonous so makes the ground mush so it can sort of just ooze into the ground.
Ledyba/Ledian: It delivers lightnign quick punches so just punches a hole, like a jackhammer.
Swinub/Piloswine/Mamoswine: You know, just because it's tiny doesn't mean it's not made for digging. It species probably adapted to digging really quickly with the feet you don't see underneath its thick fur. I bet Piloswine and Mamoswine don't dig with their tusks but use their feet too.
Corsola: Coral is pretty rigid, it can probably easily rapidly shake to dig itself into the ground.
Makuhita: How hard do you think it is to dig into the ground? Anyway Makuhita gets it probably more because Hariyama gets the move because it has BIG hands to dig with, so Makuhita gets it too (and Snorlax doesn't get it cause digging does take energy and Snorlax rather sleep & eat.
Shedinja: It's a ghost, could just phase into the ground.
Numel/Camerupt: It digs with their feet like most other quadruped?
Vibrava/Flygon: Well it's not really ground/dirt that is the reason they get Dig, it's sand. They're sand diggers and as long as the ground isn't rock hard (and even then...) they likely still have the body adaptations for digging.
Baltoy/Claydol: I guess they spin like a drill. Let's also remember something else: Pokemon are elementals. If a Pokemon wants the ground to open up, the ground will open up. Honestly this whole exercise can be shrugged away with saying "they use their land powers to create a hole they can hide in".
Regirock: Well Regirock doesn't need to worry about wearing out its rock hands as it'll just replace them, it's body is made from rocks all over the world cause its constantly repairing itself.
Piplup/Prinplup/Empoelon: Empoleon and Prinplup's wings are hard as steel, they're not going to flail around trying to dig with their head. Piplup gets it cause its evos do, but being its evos use their wings Piplup does do.
Cranidos/Rampardos: Now these two could probably just use their heads, moving dirt aside like a backhoe.
Hippopotas/Hiddowdon: They not only unleash sand but can also inhale it into their body. They also probably use the sand they spill out to help it get a start to digging.
Bonsly/Sudowoodo: Actually, since they disguise themselves as plants, I wouldn't be surprised if they dug with their foot so it looks like it's planted in the ground. This goes with Sudowoodo oddly having a few kick moves, meaning it has strong legs.
Wormadam: Once again it's probably a sand digger more than a dirt digger. Still, it's cloak could be hard enough that it can use it as a drill.
Gastrodon & Stunfisk: Makes the ground muddy and then digs in it. Gastrodon only needs to make a hole big enough for its shell, the rest of its body is soft so can squeeze in. For Stunfisk,
this is how the fish it's based on, the flounder/flatfish, digs.
Rolycoly/Carkol: Yeah digging for them is a bit of a mystery. Maybe spinning out their wheels? Could work for Rolycoly, though maybe not as well for Carkol.