Map associative array to another array php
array_replace() is the perfect call here -- it can be used to overwrite the master array with the array containing actual integer values.

Code: (Demo)

var_export(array_replace(array_map('intval', $all_states), $country_states));


To streamline the process futher, you should declare your master list with 0 values instead of null values, then you can omit the array_map() call like this:

Code: (Demo)

var_export(array_replace($all_states, $country_states));


Additional suggestions, caveats, and considerations:


You might reconsider your variable names, as they don't seem to do a great job of describing the data that they contain.  $all_states might be $statesLookup or $statesDefault.  I don't know what is being counted in the second array, but $country_states might be better declared as $state_counts or something.
If $country_states has any elements with keys that are not represented in $all_states, then these new elements WILL be appended to the end of the output array.  If this is a legitimate concern, you can call array_intersect_key($country_states, $all_states) to filter out any expected elements.
The order of the elements in the output array will be ordered by $all_states.  No matter what order the country_states are in.