Monaco's glorious climate, favoured by the famous for over a century, means that there isn't a "bad" time to visit. July and August will see temperatures cruise above 30C, and coupled with the huge crowds of tourists this can be an uncomfortable time to visit. Spring and Autumn are arguably the perfect times to go, warm enough to visit the beach but outside peak season. Even in winter, when temperatures will struggle to fall below 10, it's mild enough to walk around in light(ish) clothing. My favorite time to visit would be in May or preferably June if you want to swim (still chilly). Avoid the Formula 1 Grand Prix week (usually in May, but check as it changes every year) by all means unless you are  a big racing cars fan otherwise it is the worst time to see Monaco: the streets are blocked because they are part of the circuit and there are grids everywhere.