Its purpose is reinforcing the security of fencing, walls and/or wire fences around the perimeters of all kinds of spaces, from private homes through farms to industrial facilities, as it is a very efficient element to prevent trespassing.
The use of barbed wire is quite common as a complement to rural fencing and animal enclosures to protect against predators, etc.