Of course, as Muslims, we believe nothing is without purpose.
But what is the purpose of creating soooo many lifeless, uninhabited planets? We know that rocks are alive since they talked to Rasulullah so are atoms and planets are also alive in a way we don’t know and do they communicate with Allah?
Why did God create animals? They aren’t as smart as us and are not as conscious, some of the animals do very disgusting things. If it’s for them to worship God then how do animals pray to God, is it simply through going about their daily lives?
What about plants or insects?