"It is the prize for being a good man."
Translation:Es el premio por ser un buen hombre.
There are 27+ ways you can use "por" and about 13+ ways you can use "para". The simplest approach is to learn the 4 common cases for "para" and use "por" if none of those cases fit. Here is a video on it https://www.youtube.com/watch?v=_cBJoq479NM My guess either showing "gratitude" or "exchange" is why "por" is used here.
A simple rule, which covers this case, is that "para" is used to indicate who something is for, in the sense of receiving in the future, and that "por" is used to indicate what event in the past something is a result of. So, for example, we might say "eso es el premio para él por ser un buen hombre" for "that is the prize for him for being a good man". This rule doesn't cover all uses of course.
Well, if we ignore the "future" and "past" parts of the rule, we can think of your example as follows: the event (here in the future) is Elena's absence. We are substituting in response to that event, so we use "por". So, e.g. "voy a sustituir por Elena para la escuela": the school is receiving our action and so we use "para" with "la escuela" (I expect something like "en" for "para" would be better here, but I want to use both "por" and "para" to illustrate the rule again).