It is perfectly legal and, many would argue, reasonable to have secular reasons to do something that happen to align with religious reasons. In other words, just because there's a religious reason to do something doesn't invalidate secular reasons to do the same thing.
The New York Times had an article in 2013 that explained the origin of the federal holidays in 1870:
Congress acknowledged that Jan. 1 is "commonly called New Year's Day" and Dec. 25 is "commonly called Christmas Day."
and further on in the article:
If you read the language of the  bill, it's clear that Congress chose dates commonly celebrated as holidays by the American people, not for religious reasons but because of a history of recognition and celebration on those dates.
The federal holidays make sense from an efficiency perspective. If a significant number of federal employees will be taking those days off for celebratory purposes then it doesn't make sense to open federal offices if there's not enough staff.
Federal holidays only apply to federal employees and the District of Columbia. There's no requirement that your private employer, state employer or you recognize those holidays.