It's legal, because they offer the load and you can accept it as is, or reject it. On the other hand, if they pay the contractor a percentage, then make them show you the paperwork and have them pony up.
It's not ethical, though. It's scummy. It's just another example of a lie that carriers deny they tell. Carriers will tell you straight up that they don't lie, yet they get caught in them all the time.
Some customers do in fact get discounts. Some customer call their own shots with the carrier and will only ship if it's paying this or that many miles, regardless of how many it actually pays. Some carriers cave because they don't want to lose a customer. Some customers have actual contracts that state they will pay mileage from specific routing programs, such as Rand McNally Household Good Miles, or Mapquest.
When I'm offered a load, if the miles look a little iffy, and I can't reconcile it with the Garmin, Streets & Trips, PC Miler or Google, I'll have dispatch run the mileage on Google (to let them see it for themselves), and if it's significantly different, I'll simply turn the load down, and I'll be rather blunt why.