The previous answers are precise and nice, but a little too complex for my taste ; the weight is two because you're looking at something related to elliptic curves. If you go to other abelian varieties, you'll get more complex things (mostly higher weights... half-integer weights come in even insaner settings).
A short and elementary text about them is Serre's "A course in arithmetic". Another nice one (that is both short and elementary) is Koblitz' "Introduction to elliptic curves and modular forms".
EDIT: Let me stress again that this answer is vague and imprecise on purpose! In fact, it's easy to make modular forms of different weights appear even in the setting of elliptic curves, as the examples of the $j$ invariant and the Laurent developpment of the Weierstrass $\mathfrak{P}$ function show ; again, Serre's "A course in arithmetic" is a good reference.

