Obviously, there are the peak months when the scenery is brilliant with clear skies and crystalline views in most parts of Nepal - Oct-Dec, and March-May. But by no means should you take these as cutoff points.
First, many people love to trek in the crisp, snowy winter for the sense of adventure and really being in nature that it gives them. Second, even in the monsoon, there are routes and treks that lie in the rain shadow, such as Manang, around Jomosom, and Mustang. These are spectacular no matter what time of year you go. And finally, the bugbear of the monsoon has a worse reputation than it deserves. Yes, there are landslides and blocked highways, but that is as much a problem of infrastructure as the weather itself, and can be avoided.
By a curious quirk, most of Nepal's rain tends to fall at night, which can mean incredible mountain views in the early mornings. There can be the annoyance of leeches lower down, but this is soon passed, and anyway many trekkers have reported that with a little caution it is possible to even escape the leeches. If it rains in the day, it is often just a light drizzle and your only lookout will to be a little more careful on slippery trails.
Why should you consider trekking in the monsoon? The landscape will be a hundred shades of rejuvenating green, with all kinds of bright little flowers, when it clears the views are better than anything in the winter, with the contrast between subtropical greenery and snow peaks, and the trekkers you meet along the way will be very easygoing and often old Nepal hands.