The story
From data + center; as is generally true of English orthography for many compound nouns, the open compound was the original form and the solid compound gained acceptance over time. In the particular case of data center and datacenter, the 2020s were the decade when the solid variant went from IT-insider-jargon-only status to wide acceptance in general register.
Etymology from Wiktionary, CC BY-SA 4.0.