Of course, the object used as a medium of exchange could also be valued for some other end. Gold could be valued for dental work or wads of FRNs for a keepsake or to light cigars. But in such cases the gold or the FRNs are no longer money. The person acting has reclassified the objects themselves as consumer goods. But money itself, the general medium of exchange, has its value as a good derived from the value a person attaches to the medium of exchange function.
So a person has an end he wishes to attain. He then identifies objects in the world as suitable means to attain his end. He perceives the structure of the means in a sequence of steps to attain his end. In analyzing his action, economists refer to the good that he chooses to directly attain his end a consumer good. The goods that are used to make the consumer good economists call producer goods. The general medium of exchange economists call money. The categories are fixed and universal. In his action, a person chooses what in particular is a consumer good, producer good, and medium of exchange. But that does not affect the definitions of the categories of goods.