You have to have a place to live and you are going to pay for that place one way or another. Taxes, maintenance, mortgage, and insurance are almost always built in to the rent... so you are building value for yourself or for a landlord.
The real discussion should be about lifestyle decisions. If career or something else keeps you moving then buying may not be for you. Also, buying a home isn’t comparable to renting a small apartment. Buying versus renting should be analyzed on like properties. Chose the type of property that fits your budget and lifestyle, then decide whether to rent or buy.