Is God Selfish?

Question: Why would God make us, knowing that we were going to sin? Isn’t that selfish for Him to make us for the sole purpose of just worshiping and that’s it?