You are only able to officially buy the wifi cards at certain government offices. Of course, many of these have weird locations, long lines, and inconvenient hours. You also need to show your ID, and there are certain rules about the cards you can buy.
Understandably, this has led to an underground Wifi card selling business - which is strictly illegal. I shit you not - go to a wifi park in Cuba, walk around for a bit, and a sketchy man might glance at you or secretly flash you a wifi card. You then can discretely approach him and pay him $3 (CUC) for the officially priced $2 card.
But be careful buying the card... you never know who's watching and you probably don't want to end up in Cuban jail.