The money to pay workers comes from customers either way so Square was already getting a cut of it.
If they weren’t given an option to tip while paying with a card, plenty of people would pay with that card and then leave a cash tip in the tip jar at their favorite coffee shop (nobody is going to request that their card be run again for a tip). There are places that make you sign a receipt and add a tip—but that isn’t always part of the Square flow.
Now it’s integrated into the PoS system, so the default option is to give Square their cut for a tip.