There are some results concerning your question that go in the negative direction. Namely, in the following paper two results are proven:

Counterexamples to the Seifert Conjecture and Opening Closed Leaves of Foliations
Paul A. Schweitzer. Annals of Mathematics Second Series, Vol. 100, No. 2 (Sep., 1974), pp. 386-400.
https://www.jstor.org/stable/1971077?seq=1#page_scan_tab_contents

**Theorem D**. If there exists any $C^r$ foliation $F_0$ of $M$ of codimension
$q\ge 3$ with $0\le r \le C^{\infty}$, then there exists such a foliation $F_1$ with no closed leaves.

**Theorem C**. If there exists any $C^r$ foliation $F_0$ of $M$ of codimension
two with $r=0$ or $r=1$, then there exists such a foliation $F_1$ with no closed leaves.

Moreover, $F_0$ and $F_1$ are related by a homothopy which is defined in the article of Schweitzer.

There is also a review of Lawson from about the same time.

Lawson. Foliations, Bulletin of the AMS Volume 80, Number 3, May 1974

https://projecteuclid.org/download/pdf_1/euclid.bams/1183535509

Maybe, if you look into papers that cite these two, you'll find more results of interest to you.

Given such negative results as Theorems D and C it is a bit hard to imaging what kind of condition would imply existence of compact leaves in such setting (though I am very far from this topic).