The correct definition of this expression is to really mess something up for yourself (rather than for someone else) with an unnecessary and/or stupid act.
The key is that it is self-inflicted and therefore has a different meaning to "piss on your bonfire" or "rain on your parade" which refer to generally spoiling or putting a dampener on something for someone else.
The origin of the expression is from the scenario in the UK of a guy buying some takeaway chips (french fries for any US readers) after an evening's drinking.
Finding that he then needs a piss on the way home, the inebriated guy finds a quiet spot somewhere then and puts his chips on the ground nearby while he relieves himself. In his drunken state he then accidentally pisses on his chips, thus depriving himself of his meal through his own carelessness and stupidity.
The expression is particularly applicable for a celebrity who has badly damaged his/or her career because of a needless personal transgression.
"Way to piss on your chips, Tiger!" (Overheard at the US Masters)