Hi Mankey,
Before clearing your specific doubt, I would like to clarify here that a word may be used in more than one context and hencemay be used with different prepositions. Now this change in preposition solely depends on the meaning of the sentence.
1) Ria has a great affinity with modern arts. This sentence is not correct because "affinity" when used with "with" means similar to. Thus, this sentence means that Ria has similarity with modern arts which is illogical. The original sentence (in my post above) states:
Ria has affinity for modern arts. "Affinity for" expresses the meaning - 'liking'. So when we say that Ria has affinity for modern arts, this means that she likes modern arts.
Likewise, "affinity to" goes to show preference. In our example, we said: He has affinity to coffee among beverages. This means that he prefers coffee over other beverages.
So you see, that the same word "affinity" changes in meaning when used with various prepositions. Hence if we want to use correct expression, we need to understand the meaning that should be conveyed and then we should select the correct preposition to convey this meaning
2) This substance has more affinity for gel than for cream. This sentence means that the "substance" likes gel more than cream, which is illogical. "Substance" as we know is non-living. Then how can it like something at the first place? But when we say that This substance has more affinity with cream than with gel, it means that it bears more similarity with gel than with cream. As we have seen already, "affinity with" goes to express similarity.
Now comes the question - do we need to know this for GMAT. Probably not

I have not come across any official question that tests such usage of preposition with affinity. So this is good information to have for your general writing skills, but as such for GMAT SC, you do not need to add this to your idioms list. So why did I spend the time responding to this - this usage seemed interesting from the perspective of how meaning and idioms go hand in hand!!
Hope this helps.
