The real question is: why haven't OS manufacturers (okay, namely iOS), recognized that there is spam in texts and bring the same mechanisms we have to fight spam in email? Why can't I simply create a keyword filter for all of the current political candidates' names and auto-delete any campaign texts?
It doesn't give the app access to read your messages. The MessageFilter extension that actually handles filtering cannot communicate with any other part of the code nor the network.