What caused the spoilage of my homemade mayonnaise before 48 hours
Mayonnaise - unless made by a recipe that is explicitly designed to yield a shelf stable version (as many commercially made mayonnaises are) - is not a shelf stable food. That means the common standard of unrefrigerated storage time of 2 hours max, or 4 hours if immediately consumed, is to be applied. So spoilage after room temperature storage of 8 or even 48 hours does not seem to be a surprising behaviour.