That's the Blinded Sphinx Moth. If its hind wings were exposed, you would've been treated to a pair of usually-hidden eye spots. It was probably asleep (some moths are REALLY good sleepers) or just really didn't want to get up. The reason it seemed "glued" to the tree is because moths and other insects have bristles on their legs that allow them to cling onto surfaces like trees and walls. Since trees have a rough texture, I imagine that it would've been able to cling tighter. I'm no expert by any means, though. Moths FTW!