  We consider germs of holomorphic vector fields at the origin of
$\mathbb{C}^3$, with non-isolated singularities that are tangent to a
holomorphic foliation of codimension one. This configuration is known as a
$2$-flag of foliations. The focus is on cases where this geometric structure
originates from second-order ordinary differential equations. We investigate
the behavior of the singular sets associated with the foliations under
consideration. Furthermore, we present a classification for second-order
equations that admit a $2$-flag of foliations. Finally, we propose a general
method for constructing germs of $2$-flags of foliations at the origin of
$\mathbb{C}^n$, with suitable properties of the singular sets, and we conclude
by demonstrating that under generic assumptions, every equation of order
greater than or equal to two is associated formally with a germ of 2-flag of
holomorphic foliations at $(\mathbb{C}^3,0)$.
