The buyer's move was clean and worth understanding. He accepted that the deal met his criteria, then reframed the spread definition to include your fee inside the 38k rather than on top of it. Once he had the address, he had the leverage.
The fix is to define terms before the address changes hands. In a written buy box, spell out the spread calculation explicitly: ARV minus acquisition cost minus estimated rehab equals net spread to the buyer, and the assignment fee is a separate line item paid by the buyer in addition to that spread. Something like "buyer's net spread is calculated before any wholesale assignment fee" closes the gap he exploited.
A few operators go further and get the buyer to initial the formula itself when they confirm interest in a deal, before the property address is disclosed. That confirmation is not a purchase contract, it is just agreement on how the numbers will be counted. I am not certain how enforceable that document would be in every jurisdiction, so I would run the language by a real estate attorney before you rely on it.
The strategy guide for reverse wholesaling makes the point that the buyer relationship is the asset, and that is true, but a relationship with no written frame around fees will get tested every time the spread is tight. 38k on a 25k minimum is tight enough that the buyer felt entitled to negotiate, and in the absence of clear written language, he was not wrong to try.
One thing that might tighten this further: did your criteria sheet define "all costs" explicitly? That phrase is where the ambiguity usually lives, and knowing what you had in writing would help figure out where to patch it.