Although the chances of being challenged on a title are very low, the answer to your question is yes and yes. Yes, if the lending institution you are taking a mortgage from requires it, then absolutely, but they may only require lenders coverage, which means YOU are not covered in case anyone pops up 10 years later and screams the property you just lived in for the last ten years is theirs! There are two portions of title insurance (at least in NYS), they are lender and owner coverage. Owner coverage is less expensive and if you can swing it might as well pay the extra dollar for your coverage.
The other reason is even if you are buying all cash you still want to get title insurance, but not because that someone could come along later and say the property is mine and not yours, rather when you buy the insurance, the lawyers work SUPER hard to make sure there is not the slightest defect in the chain of title, because it is THEIR obligation to defend you for free if anyone pops up later. If you do not buy title insurance the attorney would typically issue an opinion of title and best of luck if he dug deeply into the title to make sure you can sell it later with a clean title. Kind of like a $500,000 cellphone with a bad ESN. Worth the 1k, wouldn't you agree?