I think either time of the year would be fun. On average, June is cooler than September, but the weather seems so unpredictable so it's hard to say what you'll actually experience.
HydroGuy has a useful
Detailed Weather thread that will help give you a sense of the range of weather you might experience in June and September.
As mentioned, the June dates do coincide with a couple of Grad Nite dates, but that does not usually impact part operating hours. Grad Nites happen over in DCA after DCA closes to the general public. Some folks avoid Grad Nites as much as possible, while others have reported having little or no issues with the high school students. The students do get park hopper tickets, so you'll see them in both parks during the day, so it can have an impact on the thrill ride attraction wait times. The June dates should be after the official start of the summer season, so there should be long operating hours and full evening entertainment.
Early September is a bit more iffy, especially this year. We don't yet know when HalloweenTime will start, but it's most likely either going to be September 9 or 16 if it follows historic operations. The first weekend of HalloweenTime is often very busy as guests come in to see this year's offerings (e.g., Haunted Mansion Holiday). So if HalloweenTime starts on the 9th, there may be pretty high crowds in the park. If HalloweenTime doesn't start until the 16th, then there is a good chance that Haunted Mansion will be closed (it closes usually in mid-to-late August to have the overlay installed), but the crowds might be on the lighter side because it's between "seasons."