The Greeks were bothered by mosquitoes, just as we are, and so were the Egyptians before them.
So, taking the idea from Egypt, the Greeks draped a mosquito curtain about their couches at night to have some unmolested sleep. From konops, mosquito, the Grecian name for such a protected bed was konopeion.
Romans, who found similar beds afforded great relief from the pesky insects breeding along the Tiber, borrowed its Greek name also and called it canopeum.
Thus canopy, by which we now mean almost anything in the way of an overhead covering, was originally a mosquito protected bed.