When it is clear that someone didn't bother to buy a ticket or has no intention of paying, you come down on them hard. You don't let them off 'this once' and send out all the wrong signals.
THAT will then stop people trying it on.
At the moment, people who kick up a fuss get off and the easy prey get the penalty fares and bad treatment.
The railway also needs to realise that they should staff stations whenever trains are running. At the very least, even if the ticket office is closed, there would be someone on duty who could confirm that a TVM wasn't working properly and perhaps issue a permit to travel if they couldn't sell a ticket themselves.
Totally unmanned stations should also issue permits - with the knowledge that there will be staff along the way or at the destination. If the railway doesn't have anyone at any point, but you have a permit, then you've at least done your bit.
Just as I get angry for people treated unfairly, so I get equally angry when people are punished with PFs as an 'easy option'.
Would the machine be able to 'tell' whether it had an intermittent fault or not as seemed to be the case here?
At my station, one of the outdoor TVMs will often fail in wet weather. The touchscreen stops responding in certain places, making it impossible to complete a full transaction. However, it will not be able to report that as a fault unless they have some very clever software that works out there might be a fault if people are pressing to start the ticket buying process but never complete it!
I had to explain this to an RPI who was getting ready to issue lots of PFs on the train (I personally had a season but my wife couldn't get a ticket) and feel I only got away with it because there were so many other people who boarded the same carriage who had been in the same situation. Now I suppose we could have all been in on some mega-scam planned in advance!