Add an entity reference select to a form
Basing on the OP solution, I would suggest the follow code.

$options = [];
$goal_nodes = \Drupal::entityTypeManager()-&gt;getStorage('node')-&gt;loadByProperties([
  'type' =&gt; 'goal',
]);

foreach ($goal_nodes as $goal_node) {
  $options[$goal_node-&gt;id()] = $goal_node-&gt;label();
}

$form['commitment']['goal'] = [
  '#type' =&gt; 'select',
  '#title' =&gt; t('Goal'),
  '#options' =&gt; $options,
];

This has still two issues:

Entities are not translated
Bundle label ('Goal') is not  programmatically coming