Rather than seeing it as the queen being blocked in, try to look at it as the d4 pawn being defended, something the e4 pawn is not.
why d4?

It prevents 1...e5 (sure, 1.e4 opens up some pieces, but then 1...e5 does the same), it places a defended pawn in the center, and keeps the king better defended.
To illustrate the last point: if Black defends symmetrically, White can try to apply a lever to trade a wing pawn against a center pawn, with 1.e4 e5 2.f4, or 1.d4 d5 2.c4. The first is a gambit that opens up squares and diagonals around White's own king; the second is not a gambit, and completely solid.
Also, Black can move a wing pawn to prevent White from setting up the d4/e4 duo; against 1.e4, 1...c5 is very effective, against 1.d4, 1...f5 weakens Black's king. It's still playable of course, but far far less popular.

e4 opens up many possibilities. If this is something that genuinely interests you, I would suggest you buy a book about opening theory-- there are many. I'd recommend "best lessons of a chess coach" by Sunil Weeramantry if you are looking for something that is not just about openings but also middle and end-game.

i know the theory behind e4, you open up lines for the bishop and queen. but the question I ask is what is the reason behind d4? it blocks in the queen, forcing an extra move to get to an ideal spot and opens up the bishop which is harmless to the other king.
Such "theory" is only designed for new learners to make it logical and easy for them to understand. The real "theory" is deeper than that. Sometimes you don't need to have a good explanation why a move is better than the other, but you are able to know from theory and computer analysis that a move (with best play from both sides) will eventually lead to a better position than the other.
But the importance of center squares is a proven "theory", and that's why both 1.d4 and 1.e4 are playable. The difference is that 1.e4 will often lead to an open game while 1.d4 will often lead to a closed game. Using your "theory", with 1.e4 lines are opened for bishop and queen, so the probability for direct confrontation between heavy pieces is high. And this means something.
i know the theory behind e4, you open up lines for the bishop and queen. but the question I ask is what is the reason behind d4? it blocks in the queen, forcing an extra move to get to an ideal spot and opens up the bishop which is harmless to the other king.