That's because looping was an afterthought. I think the project was initially supposed to be a purely declarative language, with Hashicorp pushing back against proposals for common functions.
Then they succumbed to demand with HCL 2. As much as I like Terraform in the general sense, their obsession with this weird DSL bothers me immensely.
Alternatively, I'm really enjoying the AWS CDK and hope Pulumi garners some more traction here.