MacBook Air sleep with external monitor attached
You have to disconnect it from power. Then it will sleep.
Seems like no other solution is found yet.

And your question seems to be a duplicate — How to disable Clamshell mode in Yosemite?