What caused the spoilage of my homemade mayonnaise before 48 hours I followed all steps I saw online but the mayonnaise looked good at first but spoiled the next day. What would also cause the oil to separate from it??

I seperated the eggs first, putting the yolk in a mixing bowl. I added vinegar,lemon juice and water.. Then I heated for about 2 minutes, I removed and cooled. I added dry mustard,salt and cayenne pepper Then I mixed together. Slowly, I added vegetable oil teaspoon by teaspoon till it reached proper consistency.

I stored the mayonnaise closed and indoors. But there was a slight oil seperation, and water separation at the bottom of the jar. Then followed by a characteristic foul smell hours later.
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.