Entity form presents all taxonomy terms instead of vocabulary
$fields['voc_type'] = BaseFieldDefinition::create('entity_reference')
    -&gt;setLabel(t('Voc Type'))
    -&gt;setDescription(t('Voc tag'))
    -&gt;setSetting('target_type', 'taxonomy_term')
    -&gt;setDisplayOptions('form', [
        'type'    =&gt; 'select',
        'options' =&gt; $array,
        'weight'  =&gt; -6,
    ])
    -&gt;setDisplayConfigurable('form', true)

    // I think you're missing this:
    -&gt;setSetting('handler', 'default:taxonomy_term')
    -&gt;setSetting('handler_settings', [
      'target_bundles' =&gt; [
        'my_vocabulary' =&gt; 'my_vocabulary'
      ]
    ]);


I don't think you need to manually gather the options and set them like that. The target_bundles setting should take care of that.