They are required in lots of places, but people don't always follow the law. It's not surprising to hear the old "the machine is broken, need cash" excuse.
Not sure about the law in other places, but in Boston that's too bad for them. You can just get out of the cab without paying if their machine doesn't work.
I never really understood that. A cab driver told me that once, so I told him that I was leaving without paying. Even if he wasn't lying, I accept no responsibility for their broken equipment.