I'm a fan of consistent behavior, but actually I'm on the side of not sleeping with a display plugged in. Going to sleep when there are no peripherals plugged in is only a sane default because there's no way to actually use the device with no access to the keyboard/mouse/screen.
OTOH, one can still reasonably use a closed laptop if it has a display plugged in, so closing the lid no longer implies an intent to stop using it. Because of this alone, going to sleep in this context might not be the most sane default.
Some examples of when I've personally closed a laptop with the screen plugged in without wanting it to sleep:
* Working at a desk where the laptop doesn't fit with the lid open
* Starting a video when connected to a TV in a dark room, where the laptop's screen is a distracting source of light
OTOH, one can still reasonably use a closed laptop if it has a display plugged in, so closing the lid no longer implies an intent to stop using it. Because of this alone, going to sleep in this context might not be the most sane default.
Some examples of when I've personally closed a laptop with the screen plugged in without wanting it to sleep:
* Working at a desk where the laptop doesn't fit with the lid open * Starting a video when connected to a TV in a dark room, where the laptop's screen is a distracting source of light