You must set the country field type value with a valid ISO-2 state code from the available options.
$entry->example = "IL"; copy
$entry->example = "IL";