I have seen no analysis as to how kills, and therefore CvC points/soul shards, are calculated by the game.
Assuming SH battles are calculated in the same way as other battles the game first calculates which army is the "larger". That is partly a matter of numbers but also a matter of unit strength. The larger army wins and inflicts 80% casualties on the loser. A second, complex, calculation then determines the casualties suffered by the winner.
In an unsuccesful SH defence 80% of all the defending troops will be lost and the kills achieved will presumably be distributed evenly with higher numbers of kills attributed to stronger troops - and troop type playing a small part depending on the make up of the attacking Jotunn troop.
In a succesful defence I take it that the calculation of casualties sustained also determines which troops made kills.
Exactly how that calculation could result in all the kills being attributed to your ally's troops and none to your troops I do not know but I suspect that your ally may have put a lot of low tier/low strength troops into the SH while your surviving troops were all of a higher tier/strength.
In case that is correct you might try agreeing with your ally what tier/strength of troops you will each contribute and perhaps that will bring about a more equitable distribution of points and soul shards.