Actually free public relay can implement basic spam filter (especially for agressive repetitive ads spam that occur almost every minutes or seconds). I don't know why this not much implemented, maybe relay operator only run relay and haven't modified relay code to add spam filter.
One that i can vouch who have already implemented this is nostr.mom by #[3]
#[1]