Pineda was ejected from the game in the 2nd inning, after the Red Sox spotted the shiny substance on his neck while he was on the mound. Even though it is believed that most players use it, it is still considered illegal by the MLB.
The MLB rule 8.02 states the pitcher shall not "have on his person, or in his possession, any foreign substance."
The rule is thought by many in the game to be trivial, but many of Pineda's criticisms were regarding his failure to be discreet about his use of the substance. Most players put it inside their belt or somewhere else where it isn't obvious. Pineda's decision to put it on his neck where it was easily seen and caught by cameras gave the Red Sox no choice but to call it out.