Simply because ebay fees apply to the total invoice, this has been in place for many many years with the full approval of the ACCC, so yes legal.

GST  applys to ebay fees, as it comes under the  S.