The description of glyph of warding is vague about how spell glyphs are made, it says that you are casting the spell to be stored as part of casting this spell, and whether this takes a spell slot for both castings is unspecified as far as I can tell.
You can store a prepared spell of 3rd level or lower by casting it as part of creating the glyph.
Best Answer
It does take two spell slots.
The first line of the spell describes what happens when you cast the Glyph of Warding:
Later, it specifies that if you choose the spell glyph option, you cast the spell you choose to store (emphasis added):
PHB 201 specifies that when the "casting" wording is used, it uses up a spell slot:
This interpretation is consistent with other game mechanics that are more explicit about how this works. For example, contingency works this way:
or the ring of spell storing: