Grouping by select - keep order of options
The group filter loops through the passed elements in the order that they are returned by your query and builds the groups array in the order that it encounters the values being grouped. So there’s no predictable way to control what order the array keys are ordered. 

If you want to loop through all entries by dealStatus in a fixed order you could replace your for loop with:

{% for status in [‘InMarket’,’postBid’,’closing’,’closed’] %}
    {% if allDealsByStatus[status] is defined %}

        {% set entriesInStatus = allDealsByStatus[status] %}

        {# your list output code here #}

    {% endif %}
{% endfor %}