<select name="tipo_imovel" id="tipo_imovel" class="form-control">
    <option value="">Todos</option>
    <?php
        foreach ($tiposImovel as $grupo=>$options)
        {
            echo("<optgroup label='$grupo'>");
            foreach ($options as $value=>$text)
            {
                echo("<option value='$value'>$text</option>");
            }
            echo("</optgroup>");
        }
    ?>
</select>