Pensé que podía ser una buena idea el reunirnos y hablarlo.

English Translation

I thought it might be a good idea for us to get together and talk about it.

I don’t understand what the word el is doing in this sentence.
Is this a valid sentence with the el in there?

N.B. I’m not sure what might be better (i.e. correct Spanish), for example “… una buena idea reunirnos …” or “… una buena idea de reunirnos …” etc.

It seems valid but redundant to me. It might be more natural at the start of the sentence: “El reunirnos y hablarlo me pareció una buena idea”.

That does not sound natural to me.