It's a trade-off. The brain is about as large as it can be while making birth possible. It already uses a lot of energy(2% of body weight, 20% of energy consumption). We also need it to be working at peak performance when we are doing activities.
A background 'scrub' task to keep it working 24/7 would probably use more energy (require more food and heat dissipation 24/7), possibly require a larger area (for redundancy, similar to how dolphins can sleep one hemisphere at a time and have really large brains). An alternative would be to slow down processes enough so that those tasks could happen constantly.
And then our day/light cycles helped select for this approach. Until recently there wasn't much one could do (safely!) at night.