i'm sorry if i come off as a satanist or anything but, how is the devil the bad guy and god is the almighty god.
in the bible, god is seen as all powerful and crap and doesn't want to be questioned, but when lucifer goes against him because he doesn't want to worship a self diluted, ignorant, power crazed ( let's face it he is kind of a dick) god he's sent to hell. Satan punishes all who is damned there by god ad all those who followed satan.
later on when god created adam and eve, he thought that giving them orders they would mindlessly follow, but as human curiosity is pretty much unstoppable satan comes in the picture and tempts them to