It seems a little odd that no-one has mentioned the well-known sociological concept of "civil religion".
Many public days of rest have religious roots. In many societies, the state has decided together with the religious authority - or authorities! - to explicitly recognize or actively promote the religious feelings of the population by making festivals part of the civic calendar.
In many, sometimes the same societies, the state actively creates secular or not so secular festivities that don't obviously stem from clearly-defined religions per se but appear to have some of the same kind of characteristics.
So, for instance, it's been obvserved that the USA has the purportedly secular Thanksgiving which has many similarities to (pre-)Christian harvest festivals, and also celebrates a "civic" tradition (origin myth?) that the state wants to promote.
In most cases the interplay of state and religious authority is pretty complex and there's some give and take.
Arguably, Christianity gradually introduced the distinction, separation and ultimately cooperation of religious and civil authorities (that had been more or less united since prehistoric times) and "demythologized" the state.
Post-Christian societies, and secular societies generally face the conundrum of legitimizing their established order by some outside principle while not being too obvious about the need for metaphysics or reference to unacceptable elements of their founding history.
So - to finally answer your question: keeping some holidays is a relatively uncomplicated and obviously beneficial way to keep the community spirit while not going into too much detail as to what specifically is endorsed or commemorated officially.