God is an inwardly lawful being; ergo, he is not the author of sin.
Yet he created the devil, who brought down a third of the angels and the whole of humanity in his fall.
But God did not make the devil to sin. God made him in righteousness, for his own sake, for a person is an end in itself.
And although he is an end in himself, he is not the supreme end of all things, but God.
Wherefore, God lawfully created the devil, with foreknowledge of his sin, for his own holy purposes.