It is legal. But basically they try to make one more percent from you.
One agent can do both and will charge 4%. If they get two people involved, they charge 5%(each 2.5%) by doing the same thing.
That's the trick. The seller may not want to lower the price more because of this 1%.
Because of this 1%, I lost a bid before.
What you can do is to ask only for one agent and lower your offer at least 1%(try more first).