I don't think it's a clause in his specific contract, but rather an NFL regulation of some sort.
Otherwise, coaches could resign and switch teams on a whim. It's why players can't "retire" with 2 years left on their deals, wait two weeks, then come out of retirement and be free agents. If the player decided to do that, they'd only be able to play for the team for whom they are currently under contract. If a coach resigned from a job with 2 years left on their contracts, they couldn't coach in the NFL for any other team until that contract expired or their team released them from the contract.
It is possible that the 49ers demanded a clause in his deal that forbids him from coaching at any college/university, but I haven't heard of that for an NFL coach.
BTW: Hugh Freeze "Les Milesed" Florida, and used them to get a new deal/extension from Ole Miss.