There is no "second ground". The ground symbol is a way of de-cluttering schematics. When you see the same symbol used in multiple places in a schematic, they are indicating the same electrical connection, or "node". The ground node has so many connections to it (perhaps hundreds) that a dedicated symbol is used instead of many of connection lines to a single point, which would make a schematic very difficult to read and understand.
We interpret that symbol to mean that it is physically connected to every other point in the circuit with the same symbol, and it is declared to have zero volts (0V) of potential. Every other node's potential in the circuit will be measured and quoted with respect to this "ground" reference point.
It is possible to have multiple independent grounds in a single circuit, but they will each use their own symbol to distinguish them from the others, such as these:
In your circuit, there is only one electrical node in the circuit which we call "ground" or zero-volts, because there is only one ground symbol repeated twice. They both refer to the same point in the circuit, because they are the same symbol, and they are physically joined with wires or PCB traces or other conductive path. These two circuits are identical:
simulate this circuit – Schematic created using CircuitLab
The above circuit (which is your second design) is bad, and can damage the LED or transistors. When both transistors are on, LED D1 will effectively be connected directly across the power supply, with nothing in the loop to limit current. Your first design is better, since current is always constrained by the 5kΩ resistor.
It's still not great though. The base-emitter junction of a bipolar junction transistor (BJT) behaves just like a diode (because that's what it is). In your schematic, when the lower input B rises in potential, that transistor will conduct current entering via its base, and leaving via the emitter, regardless of the state of the upper transistor:
simulate this circuit
That means a high input at B, to the lower BJT in your schematic, will cause the LED to glow regardless of the state of the upper transistor, which is not ideal if you are trying to implement an AND gate. It still amazes me that people publish this design claiming that it will work as an AND gate. It nearly does, and I suppose it illustrates the working principle of an AND gate, but it is a deeply flawed design.
It can be made to work, but one must take great care to ensure that base current is very, very small, compared to load (LED) current that would flow if both transistors were switched on. That is, R2 and R3 should be much greater than R1, greater by a factor of at least 10. Just be aware that an LED will glow even if the current through it is mere microamps, and therefore doesn't make a very good indicator of "on" or "off" state in this application. The circuit would work, however, with careful choice of resistor ratios. I recommend that you determine output state by measuring output potential (with respect to ground), instead of using an LED:
simulate this circuit
This design does have one redeeming feature: it forces you to consider and study the caveats of using BJTs, such as:
The difference between common-collector (used here, otherwise known as "emitter follower"), and common-emitter configurations.
The often inconvenient diode behaviour of the base-emitter and base-collector junctions.
The usefulness of Kirchhoff's Current Law (KCL), which you have experienced here as collector current and the problematic base current, both of which emerge at the emitter, as the sum of the two.
There are plenty of sites covering implementation of TTL and DTL logic gates, which you can find with a Google search for "DTL logic" or "TTL logic" such as:
Transistor–transistor logic on Wikipedia
TTL Logic Circuit Operation
DTL on Electrical4U
A search for "CMOS logic" will yield sites like this, showing how to implement logic gates using MOSFETs:
CMOS Gate Circuitry (AllAboutCircuits.com)
Here are some other answers that I have written covering quite a lot of material with regard to building discrete BJT logic units like yours:
Integrating an AND gate into another logic gate
Logic gate: electricity, voltage and meaning
Probably the most apposite: How do I make an AND gate from transistors?