The reason that expired or old aspirin can begin smelling like vinegar is because when the aspirin starts to break down and react with moisture it creates a main ingredient that is in vinegar which is acetic acid.
That formation of acetic acid happens as the aspirin breaks down and is why the old aspirin smells like aspirin and when the expired aspirin smells like vinegar it has become defective and needs to be thrown out and not used.
Even when aspirin is fresh you might sometimes smell a faint odor of vinegar but that doesn't mean it's bad but if it smells strongly of vinegar and it's expired then the aspirin should be thrown out.