This expression, meaning to be euphoric, has been around for about 70 years, and probably has something to do with being "high". But as usual, there is no simple, clear origin; and also as usual, Michael Quinion's World Wide Words site explains it best. Click on http://www.quinion.com/words/qa/qa-clo1.htm
It comes from an eastern religion (can't remember which one ) which had 9 different levels of heaven depending on how good you have been. to achive the last level you had to have been very good and would be rewarded with total peace and tranquility