Apple has added a spam filter to the Messages app in iOS 8.3. You can turn on the filter by going to Settings > Messages, then tapping the “Filter Unknown Senders” slider.