"Bogey" and "bogeyman" are the direct descendants of an old Scottish word for ghost: "bogill." Oxford English Dictionary's cite is 1505, William Dunbar: "The love glance of that bogle, from his bleary eyes ...", or originally "The luif blenkis of that bogill, fra his blerde ene ..."
Bogle evolved into bogey or bogeyman, and as many have already noted correctly, is often "spelled like it sounds," or boogieman, in the big dictionary.
In addition to the golf score (one over par), the term was also used in WWII to designate an unidentified ("ghost") plane.
Cheerio.