Why does 漠 (desert) have water in it?
First, let's look at why 沙 (sand) is related to 水(water)

Sand is found mostly on 滩岸 (beach and shore), close to a body of water  (ocean, river, etc.)

Sand is created by water eroding rock

like water, sand can 流動 (flow)



漠: 北方流沙也。——《说文》 (漠 = flowing/ moving sand in the north)

A desert is in effect, an ocean of sand. Therefore, it is closely related to sand, and sand is closely related to water.
One interesting fact -- 莫 means 'without', so you can think of 漠 as 'without water'. The person who coined the word '漠' for 'desert' might have that in mind too
Side note: 少 means 'little', I suspect the word 沙 might be coined with the idea of 'made little by water' too