Agreed, no "rules" were violated it's just not a good idea.
*If the check bounces, you have the endorsement (obligation) of only one of the parties, the one in whose account you put the lesser amount of money.
*I doubt you would have done it if customer B had not been present. However, a teller who watched you do it might not have realized that and the take away that he got was that it's not a problem. (I've led other tellers down that primrose path more than once.)
*Customer A paid Customer B $72,000, but yet has no receipt for it. If there's ever a dispute between them over the payment your bank will be involved in the proof.
Next time, Customer A can just write Customer B a check and leave you out of it.
In this world you must be oh so smart or oh so pleasant. Well, for years I was smart. I recommend pleasant.