As the question clearly asked whether it is necessary to bring a sleeping bag for backpacking, the answer is simply no, it is not necessary. To an extreme sense, nothing is really necessary for backpacking apart from your passport and money, if you are really ready to wear the same clothes every day and literally do not care your hygiene at all.
Now, whether you should bring it or not depends on the place you are heading and activity you will be doing. If you will be trekking and camping most of your trip in a place where temperature could drop quite low, a sleeping bag would come in handy and definitely offer you comfortable nights.
For those who cannot share things with other people might want to take their own as most of the time you can rent them at trekking/camping sites. However, if you will just be exploring some places and staying at cheap accommodations, light liner would do the job. It takes less space, meaning you can pack more stuff such as extra trousers or waterproof jackets.
It would also be more economic to rent a sleeping bag at the trekking point even if you will be doing bit of trekking but not too much.
Most of the backpackers I met during my own backpacking trips who carried their sleeping bags wished that they did not bother.
One person even sold his at the hostel as he never used after 20 days of backpacking. So what would be the alternative? Well, the silk sleeping bag liner has a good reputation. Unlike sleeping bags, most of the backpackers do recommend it.