Minun olisi pitänyt pitää se salaisuus.

English Translation

I should’ve kept that secret.

The english sentence is ambiguous:

  1. to keep a secret (secret is a noun here)
  2. to keep something secret (secret is an adjective)

My immediate interpretation was #2, so salaisuus does not fit.
Maybe in that case:
… pitää se/tuo salaisuutena.
… pitää se/tuo salassa.