The official reason that Italy did not enter the war was because its alliance with Germany and Austria-Hungary was defensive. Italy declared that it was not obligated to go to war because Austria-Hungary was the aggressor against Serbia.
However, we can say that there were two main reasons behind this decision.
First, Italy was not particularly committed to the Central Powers. This was especially true of Austria-Hungary. Italy and Austria-Hungary were long-time rivals and Austria-Hungary still held lands that Italy considered to be Italian territory.
Second, Italy's main goal was to help itself. Therefore, it held out of the war until it decided which side was more likely to give it a good deal. When the Allies offered Italy territory in exchange for its participation in the war, Italy entered on the Allied side.