Answer:
This phrase has been used in English law courts since the Middle Ages, possibly from time immemorial, it certainly was in use by the 13th century.
Nobody is credited with having invented it; it probably just evolved as the simplest and most satisfactory formula.
The implied meaning:
the truth - what the witness experienced
the whole truth - not leaving any material out
nothing but the truth - definitely no lies