Zhu Ba Jie - commonly referred to as "Pigsy" in English - is a character from the Journey to the West (西游记 xī yóu jì) who was originally a God, but was cast out of Heaven for being overly perverse.
Like Sha Wu Jing (沙悟净 shā wù jìng), Zhu Ba Jie was originally a general in Heaven. He once earned the title Tian Peng Marshal (天蓬元帅 tiān péng yuán shuài), as appointed by the Jade Emperor (玉帝 yù dì), commanded over 100,000 soldiers, and was charged with governing the River Tian (天河 tiān hé). Things were good, but his basic instincts always got the better of him, and one day, he crossed the line.
As the story goes, the Queen Mother of the West (西王母 xī wáng mǔ) held a banquet in her heavenly Flat Peach Garden (蟠桃园 pán táo yuán), and all celestial beings were invited, including Chang' E (嫦娥 cháng' é), the Moon Goddess.
Tian Peng Marshal, who was already well-known for placing his hands where they were not welcome, took one look at Chang' E and was completely mesmorised by her beauty. After a few too many drinks, he tricked her into entering a private room and tried to force himself upon her. Luckily nothing happened. Chang' E was able to escape and Tian Peng Marshal was brought before the Jade Emperor to be judged. For his actions he was was stripped of his title and cast from Heaven, his spirit entered the Human Realm and entered the feutus of a pregnant pig.
Some versions of the story say that this was done on purpose, as a fitting punishment for his crimes, others that it was an accident.