Speeds don’t determine this
That something has only a fly-hover speed and zero ground speed just means that it can’t move on the ground. It doesn’t say anything about whether it can or can’t stand still on the ground.
Speeds just aren’t there to give information on what media the creature is allowed to touch. If something is incapable of landing and never rests on the ground, that’s more the sort of detail that would appear in a creature’s detailed description of its behaviour and habits.
The demilich in particular lacks this kind of detail saying it only flies. Its description instead implies (but only implies) that it sometimes rests on the ground, when it says
if it is disturbed, these remains rise into the air and assume a wraithlike form.
Its history in D&D more explicitly includes it laying on the ground, including in one of its earliest illustrations in the AD&D Monster Manual II (and its accompanying description):
A classic demilich setup (as in the adventure
Tomb of Horrors
) is to have it laying on the ground until disturbed. To naive adventurers, it looks like a jeweled skull: treasure! Then it “wakes up” (it doesn’t actually sleep, though) and attacks, taking the poor adventurers off guard.