Group entity reference field by a field on those entities
Use the module Entityreference View Widget and set up a view with grouping based on location type.

Alternatively, using custom code: 

// Grab our list of all possible location types.
$location_types = list_allowed_values(field_info_field("field_location_type"));
$options = array();

// Cycle through each location type.
foreach ($location_types as $location_type_key =&gt; $location_type) {
  // Find all the nodes that are set to use this location type.  
  // You may need to adjust this query if you need to limit it to only nodes of a specific type in the event you use field_location_type on other content types that you don't want showing up in this list.
  $efq = new EntityFieldQuery();
  $locations = $efq-&gt;entityCondition('entity_type', 'node')
    -&gt;fieldCondition('field_location_type', 'value', $location_type_key)
    -&gt;propertyOrderBy('title', 'DESC')
    -&gt;execute();

  // If any nodes are found with this location type, add them to the options array under the appropriate location type
  if (!empty($locations['node'])) {
    foreach($locations['node'] as $location) {
      $options[$location_type][$location-&gt;nid] = entity_label('node', node_load($location-&gt;nid));
    }
  }
} 

$form['field_location']['und']['#options'] = $options;