DIY Console Table - Unstable Design
Two legs won't stand up by themselves. It works for a person, but that has a lot to do with center of gravity and the brain helping keep the body stable. Two sticks of metal and a slab of wood need a bit of help.
You generally won't find anything with one or two legs standing by itself, unless each leg has a much larger base attached. Think about a typical small round table. It has one leg, but the bottom will typically be a circle several inches (or more) in diameter, sometimes deliberately weighted for stability.
The solution for a table that will be up against a wall is to use some mounting brackets under one of the shelves to attach the table to the wall, ideally into studs if the walls are typical (for the US) drywall over wood frame. Done right, the legs will still support the bulk of the weight and the brackets will provide stability, so the brackets don't need to be nearly as large as they would be to support shelves without legs.