A council in Dorset which spied on a family to see if they lived in the right school catchment area loses a landmark ruling over its actions.