Could using Aloe Vera as an after shave have given me a yeast infection?

Not likely. While anything is possible, aloe vera is felt to have anti-fungal properties, making it less likely to cause a yeast infection, and possible treat one. Are your using clean razor blades, as it's possible that a shared, reused razor blades could expose you to a fungus/yeast infection!
Yeast infxn causes. Yeast infections usually result from antibiotic use, illness, chronic dampness, alterations in the normal bacteria of the body or problems with the immune system.
More likely. it is more likely that if you developed a yeast infection, that either your body was already harboring the yeast or that the razor was harboring the yeast.