You can take money out of your IRA to pay off your mortgage but the question is do you have to pay a penalty or taxes to withdraw the funds? Please note that you can withdraw $10,000 from a qualified retirement account penalty-free for the down payment on your first home. You are usually charged a ~10% penalty if you withdraw funds from a retirement account before the age of 59 1/2 so eliminating the early withdrawal penalty is a nice break for home buyers. If your spouse is also a first-time home buyer you can take out another $10,000 penalty-free, for a total of $20,000. In addition to paying for your down payment, the money you withdraw from your retirement account can be also be used to pay for home construction costs or mortgage closing costs. I am not sure if the first-time home buyer retirement account withdrawal exemption applies to directly paying-off your mortgage so you should contact a a retirement investment advisor or tax planner to answer this question.
Also, instead of withdrawing funds from your retirement account to pay off your mortgage it may make more sense to take a loan from your retirement account, especially if you can repay the loan relatively soon. Taking a loan from your retirement account may allow you to avoid certain penalties and taxes.
My best recommendation is that you consult a retirement investment advisor or tax planner to determine the right approach to using your retirement funds to pay off your mortgage.