They probably assumed the grounding would be over fairly quickly and they could get them back into the air. They wouldn't have wanted to stop production straight away as it takes months for them to get the planes built. so it's better for the bottom line to try and keep making them with an eye to quickly retrofitting any required changes and being able to deliver a large number in a very short period of time once they can fly again.
I suspect the reason they're stopping production soon is probably to do with space concerns at the factory, as there are only so many aircraft you can park up indefinitely before they get in the way of moving the aircraft that are allowed to fly out of the production hangers, and incoming parts deliveries, I think they were already using staff car parks for them months ago.
Someone has probably worked out they'll run out of storage space next month, or that they've already run out of space outside the production hangers and the ones under construction now can't be moved until they've cleared space...
Personally I still cannot believe they were allowed to put aircraft into civilian use that appear to have ignored safety lessons learned over the space of 50+ years in everything from basic aircraft handling to basic instrumentation safety, not to mention pilot training, as everything that seems to have gone wrong with the 737 max seems to be variations of things that caused crashes resulting in industry standards/requirements being changed in the past.