Imagining things that don't exist? I assume you are not talking about imagining things that do exist because who in their right mind would want to imagine something that they can instead experience?
In this case imagining is a form of running away from the real, from our lives as they unfold around us. And let's not forget that fear does not exist without imagination. And what if you are on a plane that is crashing and instead of getting a parachute and jumping, you choose to imagine everything will be all right? That is a curse. I remember Homer Simpson once said that, if things are really bad, he just curls up in bed and imagines everything is okay. We laugh because we know that is absurd. If things are good and we imagine they are bad, is that good? Or if things are bad and we imagine things are good, is that safe? It is a curse.
But if you are referring to creative imagination, as part of the process of creating a work of art than that is a different process and a different state altogether and that is a blessing, there is no insanity when a writer writes a story. But there is when we are daydreaming and walk out onto the middle of the road and are hit by a car.