Then glut thy sorrow on a morning rose, Or on the rainbow of the salt sand-wave, Or on the wealth of globed peonies; (15-17)
The speaker asks us to focus on beautiful things when we're depressed. But it's not because those beautiful things will cheer us up—he wants us to remember that beauty and sorrow are closely linked together. Beautiful things will eventually fade away and die, like a rose or a rainbow or a peony.
Ay, in the very temple of Delight Veil'd Melancholy has her sovran shrine, (25-26)
The speaker uses a different metaphor this time to emphasize the close connection between pleasure and melancholy. You can be worshipping in the metaphorical temple of Delight, only to discover that sneaky old Melancholy has a shrine there, too. Apparently, you can't worship Delight without also worshipping Melancholy.