In What If... on Yamim Tovim (page 242-244), Rav Zilberstein addresses whether a Sofer may write a Sefer Torah specifically for the purpose of sending it to the moon.
He begins by citing the Yerushalmi (Peah 1:1), where Rebbe sent the non-Jew Artvon a Mezuzah. The Netziv (Emek She’eilah 145) questions this: a Mezuzah written without specification must be hung on a Jewish doorpost; a Mezuzah may not be hung on a non-Jew’s doorway, as he has no obligation of Mezuzah, and that would be degrading to the scroll written for the Mitzvah. The Netziv answers that it must be, then, that Rebbe specifically had that Mezuzah written for Artvon. He quotes a precedent for this from the Yerushalmi (Sanhedrin 3:9) which says that Sifrei Torah written in Eretz Yisrael may not be removed from Eretz Yisrael unless they were specifically written to be brought to the Diaspora.
Based on this, Rav Zilberstein at first suggested that it should be permissible to write such a Sefer Torah with the intent to take it to the moon. However, he differentiates between the two cases, saying that it’s a disgrace to the Sefer Torah to be brought to a barren place where it will never be used, and “the fundamental disgrace of the Sefer Torah never being used cannot be mitigated by writing it with that intent.”
If Rav Zilberstein ruled that sending a Sefer Torah specifically written to be sent to the moon is still forbidden, all the more so to send one which was written to be used should be forbidden!
EDIT: This same logic is brought in Feldheim’s Veha’arev Na, volume 2, pages 509-511.