Add an entity reference to a user
For those of you who may be looking to answer the same question, here's how I got it to work in my case (I'm working on a Drupal 8.3 site):

$users = [
  'test_local_contributor' =&gt; [
    'password' =&gt; '1testme1',
    'langcode' =&gt; $language,
    'preferred_langcode' =&gt; $language,
    'email' =&gt; 'test_local_contributor@example.com',
    'roles' =&gt; [
      'employee',
      'local_contributor',
      'testuser',
    ],
    'location' =&gt; [
      'Kentucky',
      'Paradise',
    ],
    'sbu' =&gt; 'energy',
    'bu' =&gt; 'natural_gas',
  ],
  ...(there were other test users, omitted for brevity)
];

foreach ($users as $key =&gt; $user) {
  $newUser = User::create();
  $newUser-&gt;setUsername($key);
  $newUser-&gt;setPassword($user['password']);
  $newUser-&gt;enforceIsNew();
  $newUser-&gt;setEmail($user['email']);
  $newUser-&gt;set('langcode', $user['langcode']);
  $newUser-&gt;set('preferred_langcode', $user['langcode']);
  foreach ($user['roles'] as $role) {
    $newUser-&gt;addRole($role);
  }
  $newUser-&gt;set('status', 1);

  if (isset($user['bu'])) {
    $term = \Drupal::entityTypeManager()
      -&gt;getStorage('taxonomy_term')
      -&gt;loadByProperties(['name' =&gt; $user['bu'], 'vid' =&gt; 'tx_business_unit']);
    $keys = array_keys($term);
    $newUser-&gt;set('user_bu', $keys);
  }

  if (isset($user['sbu'])) {
    $term = \Drupal::entityTypeManager()
      -&gt;getStorage('taxonomy_term')
      -&gt;loadByProperties(['name' =&gt; $user['sbu'], 'vid' =&gt; 'tx_sbu']);
    $keys = array_keys($term);
    $newUser-&gt;set('user_sbu', $keys);
  }

  $loc_keys = array();
  foreach ($user['location'] as $location) {
    $newkeys = array();
    $term = \Drupal::entityTypeManager()
      -&gt;getStorage('taxonomy_term')
      -&gt;loadByProperties(['name' =&gt; $location, 'vid' =&gt; 'tx_user_location']);
    $keys = array_keys($term);
    $newkeys = array_merge($loc_keys, $keys);
    $loc_keys = $newkeys;
  }
  $newUser-&gt;set('user_location', $loc_keys);

  $result = $newUser-&gt;save();
}