Quality is a general term, purity is much more specific.
You could have a product which is incredibly pure but is of the wrong quality, say the spec' calls for it to be a dilute product not 100% pure.
Quality depends on a specification, whereas purity is a measurable attribute.
Without a spec' or a general concept like 'fit for purpose' quality is meaningless.
health warning: These posts may contain traces of nut.