It is quoted in every spiritual book that only that happens what god has decided then where does doing good or bad come from. If everything is decided by him then what are we doing here, and what are our duties?
Everything is decided for animals. But humans have Viveka, the sense of discretion. God gave choice to human beings, to chose the right or the wrong. Right is something that gives you long term happiness, which may be at the cost of short term sufferings, and the wrong is something that gives you short term joy at the cost of long term sufferings.