Short version, a house is an asset. But an asset is not necessarily an investment, or a wise investment.
Assets and liabilities
If your interest is focused on labels and classifications then anything one can utilise (benefit from) due to owning it, is an asset. My shoes, my computer, my house, any rights I may have under a contract or lease, any rights that come with my property, any money someone currently owes me and will have to repay (but not future interest on the loans) - these are all assets. I own them, and can benefit from them.
Similarly, the loan I take to buy a car, or a computer, or my house - these are all liabilities. They are the assets of whoever owns the debt (the lender or finance company I borrowed from).
Assets bought with loan/finance
Sometimes the two work as a package. I might buy a car or a property using finance from a company (hire purchase of a car, mortgage on a house). In that case you can look at the two parts separately or as one package - both are valid views depending what you are doing. So you have an asset (you own the car or house) and also a liability (you owe someone else for the unpaid loan/finance you borrowed to buy them).
Typically the loan/finance is secured - if you don't keep up payments they can take the asset to pay your loan. But unless that happens, even though you have repayments to make, the car or house is yours and you have full ownership rights.
You can see the importance of this, by imagining you buy some asset with finance, and the asset changes value a lot. Say you buy a house (or car, or painting, or stocks/shares), and the value doubles in a few years, all that extra value is usually yours, because you own the asset, even though you have finance on in. Equally suppose the value halves after some years, all that loss is yours as well, because you still owe the original finance repayments.
This shows how the asset and liability are actually still two separate things.
Assets and investments
An investment is usually an asset you bought, specifically believing it will gain value or generate money for you over time. You might also use your house or enjoy a painting in the meantime, but it is considered an investment as well, if you expect it to generate money (wealth) for you over time, just because you own it. That's a very rough definition - more technical definitions do exist, but you get the idea.
When you buy something expensive, you usually consider questions like risk (what are the odds of gaining and losing money on it, and the best/worst outcomes), return (what will you get from owning it), affordability (do you expect to be able to maintain repayments on any finance/can you afford to sacrifice existing money to buy it or make a down payment), and time scale (how long a period of time will you probably want to hold it for, and what is likely to happen in that time). These questions become much more important when you are buying something as an investment.
Emotional security/value of property
Houses mean more than just money to most people. No discussion would be complete without recognising that fact.
For example, it may feel more secure emotionally, to buy a house and know that if repayments are kept up, you don't have to move in future. Within broad limits you can live in it as you wish, decorate and furnish it how you like, give it to your children to enjoy after you, and nobody can say otherwise or take it away from you. It is yours. That emotional security could be a benefit itself.
Property as an asset and investment
So you can see that a house you own can be viewed in several ways.
As an owned item, it is an asset, possibly bought with a loan (which is a liability). You own it, can use it, and any gain or loss in its value is your gain or your loss.
The liability is separate. If you keep up repayments then eventually your liability vanishes (the loan is paid off), and only the asset is left. If you don't keep up repayments, the lender usually has a right which you agreed to, to take the asset and use it to repay the liability. If there is money left over, it's yours, if there isn't enough money you will still owe them the balance you haven't repaid.
As an investment, you house and its finance (if any) work as a package. You might consider how risky it is (risk of house prices rising and falling), money saved (rent), risk of extra money needing to be spent (if there is a problem you have to fix it, not some landlord), affordability (you can't so easily sell a house as change where you rent, if you need a lot of money suddenly), time scale (you might figure 30 years ahead the house will be worth much more than it is now. But it might not, or you might lose your income and be unable to pay the loan).
So as an investment, the house can be a good or a bad idea, depending on your personal situation and your "take" on the future.
So when you think about buying a house (or indeed any significant asset), you are balancing all these - the benefits and risks of ownership, the possible requirement to get a loan/finance (credit record, present+future ability to repay, willingness to commit to repayments), risk of future unexpected expenses etc, and the risks/rewards of it as an investment, and the possible emotional value which it may or may not have.