You're wondering why god doesn't make the world a happier place for everyone (to rephrase it slightly).
Think of god as similar to a parent. Parents want their children to be happy, right? And what makes children happy? Toys and candy! Therefore, a good parent should give their child all the toys and candy they want ... right?
Obviously, if a parent raises their child like that, their child with be sick and spoiled rotten. So the best option for the child might not be the option the child wants the most.
Heck, parents even subject their kids to quite a bit of suffering (school, dental appointments, braces), but in the long run it works out best for the kids.
And even once you become an adult, the unpleasant things you go through are still some of the experiences that lead to the most personal growth.