Is there an example of a simply-connected, compact, symplectic manifold $(M,\omega)$ such that $\omega|_{\pi_2(M)}=0$ (in the sense that $\int_{S^2} \sigma^* \omega=0$ for any smooth map $\sigma: S^2 \to M$)? Preferably with $\pi_2(M)$ being free.
This question is motivated due to the usual hypotheses made on $(M,\omega)$ in order for the related action functional to be well-defined.
By the Hurewicz Theorem, there is an isomorphism $\pi_2(M) \to H_2(M; \mathbb{Z})$ given by $[f] \mapsto f_*[S^2]$. As continuous maps between smooth manifolds are always homotopic to smooth maps, there is a representative of $[f]$, call it $\sigma$, which is smooth. In particular, every $A \in H_2(M; \mathbb{Z})$ is of the form $\sigma_*[S^2]$ for some smooth map $\sigma : S^2 \to M$.
Note that
$$\int_{S^2}\sigma^*\omega = \langle[\sigma^*\omega], [S^2]\rangle_{S^2} = \langle\sigma^*[\omega], [S^2]\rangle_{S^2} = \langle[\omega], \sigma_*[S^2]\rangle_M$$
where the angled brackets denote the pairing between second cohomology and homology.
Now consider the map $\Phi : H_2(M; \mathbb{R}) \to \mathbb{R}$ given by $A \mapsto \langle[\omega], A\rangle_M$. If $\int_{S^2}\sigma^*\omega = 0$ for every smooth map $\sigma : S^2 \to M$, then by the observation above, $\Phi(A) = 0$ for any $A$ in the image of the map $H_2(M; \mathbb{Z}) \to H_2(M; \mathbb{R})$.
By the Universal Coefficient Theorem, there is a short exact sequence
$$0 \to H_2(M; \mathbb{Z})\otimes\mathbb{R} \to H_2(M; \mathbb{R}) \to \operatorname{Tor}(H_1(M; \mathbb{Z}), \mathbb{R}) \to 0.$$
As $\mathbb{R}$ is torsion free, we see that $H_2(M; \mathbb{R}) \cong H_2(M; \mathbb{Z})\otimes\mathbb{R}$; in fact, the same argument shows that $H_k(M; \mathbb{R}) \cong H_k(M; \mathbb{Z})\otimes\mathbb{R}$ for any $k$.
It follows that the image of $H_2(M; \mathbb{Z})$ in $H_2(M; \mathbb{R})$ is a basis for $H_2(M; \mathbb{R})$ and so $\Phi$ is the zero map. By Poincaré duality, we must have $[\omega] = 0$, but this is impossible as a symplectic form on a closed manifold is never exact. Therefore, there is no such example.