There exists an exact sequence $0\rightarrow \mathbb{Z}\rightarrow\mathbb{C}\rightarrow\mathbb{C}^*\rightarrow 1$ defined by the expontial map which induces an isomorphism $H^2(M,\mathbb{Z})\rightarrow H^1(M,\mathbb{C}^*)$, this gives the correspondence between $H^2(M,\mathbb{Z})$ and line bundles which are classify by $H^1(M,\mathbb{C}^*)$ via the identification with Cech cohomology. 

The previous correspondence identifies the element of $H^2(M,\mathbb{Z})$ with the Chern class of the line bundle, it is for that reason that the condition is needed. Given a line bundle define by the trivialization $(U_i,g_{ij}$, you can suppose that there exists a local lift $g'_{ij}:U_i\cap U_j\rightarrow \mathbb{C}$ and $c_{ijk}=g'_{ij}g'_{jk}g'_{ki}\in \mathbb{Z}$ is a way to describe the Chern class of the line bundle.

If the class of $\omega$ is not rational, you can associate to it a gerbe (sheaf of categories) I used this approach in this paper.

Aristide, Tsemo. "Gerbes, 2-gerbes and symplectic fibrations." The Rocky Mountain Journal of Mathematics (2008): 727-777.