Yosemite auto creates multiple desktops (spaces) on main monitor
It has to do with the 'separate space' feature for external displays Apple introduced in OS X 10.10 Yosemite: If the setting "Displays have separate Spaces" in System Preferences -> Mission Control is activated (see https://support.apple.com/kb/PH18809?locale=en_US), every time you hook up a display a new space will be created for that display. After you pull the plug, OS X will not delete that created space, hence accumulating lots of spaces over time.

If you don't activate the option, you're external display will behave like before 10.10: only one menu bar on the main screen etc.