Should a marketing consultant work for a previous client's competitor?

Been there, done that. Definite yes in the case that the competitor is pursuing a new vision.

Either way, it's up to your own ethical code.

Investors fund competing startups all the time. You could call it cannibalization or just increasing the odds of success. Your call.