I felt it was much too long since we’d revisited the glorious days of sail for a word origin…
A lee shore was always a danger to sailing ships – the closer you got to a lee shore the less room for manoeuvre you had, and the stronger the chances of being driven ashore. The order might be given to luff, i.e. steer the ship’s head away from land and as close into the wind as possible in order to avoid running aground.
This idea of standing away from shore came to be used in the sense of standing apart from something or someone, and to luff evolved into aloof.
(Incidentally, I think this cropped up in a previous post but the very idea of giving yourself as much room as possible when approaching a lee shore give rise to another well known phrase: leeway.)