Spam in Google search results is due to Google happily taking money from the spammers in exchange for promoting their spam, or that the spam sites benefit Google indirectly by embedding Google Ads/Analytics.
I don't see any spam in Kagi, so clearly there is a way to detect and filter it out. Google is simply not doing so because it would cut into their profits.
The reason you don't see spam in Kagi is because nobody is targeting Kagi specifically.
They can probably get away with a lot of stupid rules that would backfire if anybody tried to cater to them specifically.