Let no man say when he is tempted, I am tempted of God: for God cannot be tempted with evil, neither tempteth he any man:
Now James moves on to a different use of the word which was translated temptation. Here, James IS referring to temptation to sin; he is no longer discussing the tests and trials of life. James has made a transition from temptation, or trials, as a noun to the use of temptations, or sin, as a verb. He is talking about the act of sin.
The discussion of the origin of sin and evil in the world could be, and has been, written about in volumes. We aren’t going that deep here.
Clearly God allows and even causes things to be placed into our lives that will test and grow our faith; we have talked about that up to this point. This is not true of temptation to sin. God Himself cannot, of course violate His own Law; nor can He even entertain the thought of doing something out of His nature. In the same vein, God will never place temptations to sin and perform evil into our paths as a way to test and refine us. That is what we are being taught here.
Although God did not create, and is not responsible for sin, He did create us with free will. It did not take man long to exercise his free will and blow it. Even then, nobody wanted to assume responsibility for what they had done. Eve blamed the serpent; Adam blamed Eve and Adam even blamed God.
James is simply teaching us that our sin, and our actions, are our responsibility. Jesus saves us,and forgives us, but we are responsible for the things we do.