Adding validation to widget settings form
Once again, I've found the solution to my issue. Although I said that I had tried #element_validate in my original post, I must have messed something up, because that turned out to be the solution. Here is the code:

class SomeWidget extends WidgetBase implements WidgetInterface
{
  public function settingsForm(array $form, FormStateInterface $form_state)
  {
    $element['my_field'] = [
      '#type' =&gt; 'textfield',
      '#title' =&gt; t('My Field'),
      '#default_value' =&gt; $this-&gt;getSetting('my_field'),
      '#required' =&gt; TRUE,
      // Add your validation here
      '#element_validate' =&gt; [
        // settingsFormMyFieldValidate() is arbitrary. Choose something descriptive
        [$this, 'settingsFormMyFieldValidate'],
      ],
    ];

    return $element;
  }

  public function settingsFormMyFieldValidate($element, FormStateInterface $form_state)
  {
    $submitted_value = $form_state-&gt;getValue($element['#parents']);
    if($submitted_value != 'something it should equal')
    {
      $form_state-&gt;setError($element, t('You submitted a bad value'));
    }
  }
}