This WAS done years ago.  If you "flip" a property it is supposed to be treated as business income rather than a capital gain, so not only do you not get the principal residence exemption, you also pay tax at the full inclusion rate rather than at the 50% capital gains inclusion rate.

Enforcement, however, may be a bit lacking.  The Conservatives started looking into this in more depth a few years ago and the Liberals have continued that with new reporting requirements, starting for the 2016 tax year, for the sale of real estate, including your principal residence.