A leg to stand on

This idiom or expression means:

A support.
Supporting material.
Available influence or power.

When someone says “He doesn’t have a leg to stand on,” they mean something like “He doesn’t have enough data to support his theory,” or “He doesn’t have an alibi to help him in his defense,” etc.