Imrans bowling peak from 80 to 88 was around 48 tests and he averaged 40 with the bat then. He then played 15 tests as a pure bat towards the end, averaging 72.
Sobers from 61 onwards took over 3 wickets a tests for around 60 games, coinciding with his batting peak.
Kallis had around 60 odd tests in the beginning taking 2 wickets a test, and as he took over a SAs main bat, his bowling output decreased to 1.5 wickets a test for 100 tests.
So Kallis compared to Imran and Sobers wasn't test class standard as a bowler while batting for the majority of his career. That is the major difference. As his career progressed, his bowling diminished, whereas with the other two, their second discipline was still doing strong.
I start this reply saying that I consider Kallis nothing more than a mediocre bowler.
Now a major factor which contributes to the wicket per match statistics is the quality of bowlers you have in your team.
Warne and Muralitharan are of almost the same caliber, but...
Muralitharan has 6 wickets per match whereas Warne has only 4.88 wickets per match. This significant difference is because Warne's team mates were McGrath, Gillespie and Lee. Muralitharan had the opportunity to grab more wickets in the match because only Chaminda Vaas matches the stature of Lee or Gillespie that too up to a certain extent. since the rest bowlers in him team were of mediocre stature Muralitharan had the luck to get more wickets. If Muralitharan played in for Australia instead of Warne along with McGrath and others surely he wouldn't have the luck to get 6 wickets per match as he wouldn't to ball as many overs as he did since Australian bowling attack would finish the opposition quicker than Sri Lanka generally. surely his wickets per match would drop as his fellow team mates will also grab wickets.
Similar is the scenario here
South Africa had the best bowling attack ever in the long run throughout the mid 90s till the mid 2010s.
Donald, Pollock , Ntini, Steyn (Ranked no.1 from 2008 - 2013), Morkel and Philander (best ever peak of this century - 50 wickets in just 7 tests)..so Kallis didn't have much luck there like Sobers to grab more wickets/ per match.
If South Africa had bowlers like Hall, Griffith and Gibbs instead of the above mentioned bowlers he would've grabbed more wickets/per tests since South Africa would require him to 'BALL MORE' and would get exposed more with the new ball which was not required since South Africa had Donald and other greats and they would get the work done upto a large extent. Even if Sobers bowled with these legends his tally would also drop from 2.6 wickets per tests since he would only be allowed/required less to 'BOWL PER MATCH'
Also like Kallis Sobers tally also reduced to 2 wickets per match from 3 when he out of his bowling peak which you never mentioned.