1. Question: Why does Rav Moshe Feinstein (Igros Moshe Orach Chaim 2:77) poskin that if a Jew purposefully carries keys in the public domain in order to open the shul then the congregants may not enter the shul until it is relocked and opened by a non-Jew, since the congregants walking in are benefiting from the door being opened, however he says in (1:126:3-4) that one is only forbidden to benefit from the prohibition of Shabbos for his own benefit if transgressed but one may benefit if it is for the sake of a mitzvah, like here where they are going to daven in shul? (See Dirshu Mishna Berura 318 footnote 28 and page 39 footnote 9.)
A. The Mishna Berura 318:1 says there is a rabbinic fine that one may not ever get any benefit from a Torah prohibition that he himself purposefully transgressed and others must wait until after Shabbos to benefit from it.
B. The Be’ur halacha (2nd one in the siman) quotes a Chaye Adam that though this fine only applies to prohibitions which caused the actual object to change like by cooking or planting, or lighting a fire but, for example carrying in the public domain doesn’t change the object carried at all, but still you should be strict and not benefit from the object carried, at least until after Shabbos.
Answer: Because there is an easy solution of ow to fix the problem by getting a non-Jew to reopen it then it’s considered benefit for yourself to walk through the do that was opened by the Jew and not for the sake of a mitzva.