There are lots of different caller spoofing technology out there, and many different services to provide it. Initially, caller spoofing services were developed in order to allow law enforcement agencies, private investigators, and collection agencies to better perform their jobs. It made it possible for these professionals to make calls without being traced or identified.
However, these days, there is an abuse of caller spoofing technology that runs rampant. Fake movie numbers (555-555-5555) have been used, numbers from "Satan" (666-666-6666), and even numbers from pi (314-159-2653). Services that allow anyone to do this same practice are available everywhere on the internet.
Indeed, the services are still intended for people who will use them legitimately, rightfully, legally, and without the intention to harm or deceive. Though they do attempt to screen the users so that only people who "should" be using these services do. However, there is no real way to stop the average consumer from using the services being offered.
The costs are not high (typically with a service fee per month and/or a per-minute fee for each call). This cost allows the user to show up as any number on caller ID.
The technology itself works through either the PSTN or VOIP, and the caller spoofing service essentially controls the call throughout its entire length. Indeed, that company provides a legal disclaimer as they do not wish to be held responsible for anything the users say or do while using the service.
VOIP offers a great deal more opportunity for call spoofing than standard PSTN. Using this technology in order to participate in pranks is now breaking the law. However, call spoofing services themselves remain legal. The technology is allowed, it is the way in which it is used which can be prosecuted.
Less common, but also available are call spoofing technologies that emulate the Bell 202 FSK signal (also referred to as orange boxing), as well as switch access to the SS7 network so that it appears - even to telephone company operators - that a call is being placed by another existing phone number. Lastly, and very uncommon, is VXML, which was growing popular before VOIP, but is now pretty much stagnating.