How could spirit bomb kill Majin Buu? How could spirit bomb kill Majin Buu when Frieza wasn't much affected by it? 

All of us know that Majin Buu was far stronger than Frieza.
The spirit bomb against Majin Buu was simply far more powerful than the one used against Frieza.
The strength of a spirit bomb depends on the amount of energy the user can gather.
During the fight against Frieza the energy comes from Namek and some nearby planets. At that point the population on Namek was quite decimated so there wasn't much energy from there.
Against Majin Buu the energy came from the strongly populated Earth, the Other World, New Namek and the rest of the surviving planets of the sector. 

Source : Dragon Ball Wiki articles regarding the Spirit Bombs against Frieza and Majin Buu.