Setting a field on an entity form to be required
It is really annoying... I struggled with that several times as well. The important key is places deeper in the array. Take a look on   

$form['field_ref_download']['widget'][0]['target_id']['#required']