The very short answer is that Yoda is certainly theoretically capable of casting Force Lightning, but to do so would require a 360° rethink of his Light Side philosophy. Basically he would need to discard a lifetime of Jedi teachings and become a Sith before he could do it.
The StarWars.com website notes that Force Lightning is a specifically dark side power, one that requires the user draw on anger and hatred to disfigure the Living Force enough to draw raw energy from the Force itself. Yoda and Mace (and Luke) are said to be capable of deflecting it, but there's no indication that they can generate it:
Force lightning is a dark side ability used to torture, disfigure, and even kill one’s victims. Blue in color, Sith shoot Force lightning
from their hands by calling on their hatred and aggressive feelings.
However, while a deadly weapon, it is not unstoppable. Force lightning
can be deflected and absorbed by a lightsaber, and select Jedi have
proved able to neutralize the technique through the power of the light
side. - Star Wars Databank: Force Lightning
Palpatine raised his spidery arms toward Luke: blinding white bolts of
energy coruscated from his fingers, shot across the room like
sorcerous lightning, and tore through the boy’s insides, looking for
ground. The young Jedi was at once confounded and in agony — he’d never
heard of such a power, such a corruption of the Force, let alone
experienced it. - Star Wars: Return of the Jedi - Official Novelisation