It costs money because there are significant fixed and incremental costs to handle it: Fixed because of the labor and value of the technology, and incremental because of fraud. Much of the incremental cost is fraud insurance.
There are many ways banks could reduce the fraud, but US banks don't need to since nobody is protesting the fees. In Europe however, where interchange fees are regulated to low levels, they have been quick to adopt/mandate features like chip-and-PIN and 3DSecure that lower fraud.