In the Keset haSofer (1:ד) R' Ganzfried mentions that some hold that a Torah written by a mamzer is passul. In the Lishkat haSofer (ad loc.) he brings that most hold that there is no problem for a mamzer to write tefillin and mezuzot. However, the Bi'urei haSofer (part of R' Yaakov Meir Stern's definitive Sefer Mishnat haSofer) mentions that according to many opinions, a mamzer cannot be mekadesh haShem, making them incapable of writing any sta"m.
All of this seems very confusing to my chevruta and me. Now, a few hours after having learned the above, I have the following questions:
Who permits a mamzer to serve as a sofer?
If the mamzer is incapable of sanctifying Hashem's name, how can he write tefillin and mezuzot, per the Lishkat haSofer?
Why can't a mamzer be mekadesh haShem?