Is mortgage repayment always better investment choice?

How taxes figure into decision