Karma is primarily used to keep up with what god likes you and which ones hate you in return. At the beginning of the campaign Karma is set to 0 with all gods. If the counter reaches -4 with any gods, those gods will refuse to let you play their next mission. However from fifth mission and further Karma allegiances don't count, but rather the gods you can play with are non-arbitrarily chosen beforehand. Put alongside the fact that access can't be withheld the first two missions due to the inability of collecting -4 so soon, Karma can only affect the mission choice for the third and fourth missions.
Other than that, Karma affects very little of the game. The most notable example is Sirocco, a dragonheroine who after being rescued, can follow you on your missions for a long time if Karma with Persephone is sufficiently high(?). Other example includes the rangers and a gnome who join you in Charnel's fourth mission if your Karma with Persephone is high enough(?).
Karma is gained by doing missions and getting boons for a particular god. It is lost by playing a mission with anybody else then the desired god, unless that god profits from that missions. Most usually, all karma gains and loses follow the following rules:
+2 Karma is received with the god you perform a mission for
-1 Karma is received with the other four gods (unless one of them directly profits or is hindered from your mission)
+1 Karma is received with the god that profits from your mission (this must be different than the god that gave you the mission)
-2 Karma is received with the god that is hindered by your mission (this must be different than the god that gave you the mission)
There are also special occasions when you receive additional Karma:
+2 Karma is received with the god that grants you a boon
-4 Karma is received with the god that you betray (the one you were performing the mission for, making the total Karma count to a -2)
+4 Karma is received with the god that you betray your current god for (this is usually the god you were initially working against, making the total Karma count to a +2)
Karma, like boons, is only obtainable in the first six missions.