As Allah s.w.t. has based the system on freewill so he is giving chance to good people to be good by their own free will and bad people with their own free will. Although Allah s.w.t. helps a lot but the system of free will has its own effects, which for some appear to be good and for others bad.