"Having a life", et al, is a class of idioms for having friends, interests, and other reasons for "wanting to get up in the morning".
A person that "doesn't have a life" is presumably getting up, going to work, coming home, doing laundry, then going to bed, with little else beyond eating, being depressed, and perhaps some TV and Internet browsing. (Stack Exchange excepted, of course!!)
But in particular the imperative expression "Get a life!" is used to imply that the target person has so little "life" in the above sense that he is meddling in stuff he should stay out of, or is being critical of things he knows nothing about.