It functions as lightweight, portable bedding when a person is sleeping outdoors (e.g. camping, hiking, climbing etc.). The sleeping bag is essentially an insulated quilt that can be closed with a zipper or similar means to form a tube.
The entire purpose of a tent is to provide warmth and thermal insulation through its synthetic or down insulation. In addition, tents usually have a water-resistant or water-repellent exterior that prevents wind chill and light precipitation to some extent, but tents are generally used in dry or warm weather.
As for protection against damp ground, a plastic tarp or groundsheet is usually used instead of the bottom surface of a sleeping bag. The bottom surface of a sleeping bag might be somewhat water repellent