The joke is a play on words. To say 'it wasn't working out' implies that something didn't mesh well or it wasn't appropriate or wanted.   'Working out' however is a phrase that means exercising, typically in a gym or outside. A personal trainer may typically work at a gym.
The personal trainer quit his job because it wasn ' t working out .