Join a 'default' value only when there is no fully matching record
You should be able to get it by using an OUTER APPLY join plus TOP 1

select
    *
from 
    righttable r 
where 
    (r.race=1 and r.program = 'gold')
    or
    r.race is null
order by
    case when r.race is null then 1 else 0 end


returns:

commission | program | race
---------: | :------ | ---:
        14 | gold    |    1
        23 | gold    | null


but you just need the first row, that you can get by using a TOP 1 in this way:

select
    l.race, 
    totalvalue = sum(value), 
    commission = SUM(value * (commission * 0.01))
from 
    lefttable l
outer apply
    (select top 1 
        commission 
     from 
         righttable r 
     where 
         (r.race=l.race and r.program = l.program)
         or
         r.race is null
     order by
         case when r.race is null then 1 else 0 end) r
group by
    l.race;




race | totalvalue | commission
---: | ---------: | :---------
   1 |        100 | 14.00     
   4 |        100 | 23.00     
   5 |        100 | 23.00     


db&lt;>fiddle here