Adding small amounts of moldy mulch to your compost is perfectly fine, especially if you turn your mulch regularly.  However, adding large amounts of heavily contaminated mulch may ruin the composition of your compost. Thus, it would be better to dispose of it through other channels.