Yes. You should get title insurance when buying a home.
A realtor will ensure that you get title insurance. In fact, the closing usually takes places at the title company's office. If you get a mortgage, title insurance is usually required.
Title insurance protects you from claims against your new home. This could include any unpaid liens or taxes. It's quite possible that the previous owner has an unpaid bill for a kitchen remodel. The contractor puts a lien on the house. Without title insurance, you might be responsible for this lien.
Title insurance also ensures that nobody else claims ownership to the home. For example, let's say you find a home listed for sale with seller financing. You give a down payment and start making payments. But, the actual owner has been living in Florida for the winter and you've been making payments to a scammer. The person who sold you the house didn't actual have ownership of the house. Title insurance protects against this.
In conclusion. Get title insurance!