If this were a "modern" phrase, you could (perhaps) justify it based on psychological science, related to the usage of energy by brain activity, including putting attention into something. As such "pay attention" could have emerged as "pay the cost of some mental energy into giving attention to something".
However, it seems this phrase dates at least from half of the XVIII century (axis below from 1600 to 2008):
So, the scientific justification given above might not apply to such phrase. I cannot find any answer for this online (other forums are unhelpful, e.g. here or here).
So, what is the origin of such phrase?
Note: there are several question in this site about when to use that or an alternative expression (e.g. here, here, and here), which is not what I am asking.
Best Answer
Pay in "pay attention" has no connotation of expresiveness, both in term of energy or else. As suggested by the following source, pay here refers to the old meaning of "bestow, give";
(The Grammarphobia)