Catalyzes an early step in the biosynthesis of tetrapyrroles. Binds two molecules of 5-aminolevulinate per subunit, each at a distinct site, and catalyzes their condensation to form porphobilinogen. {ECO:0000269|PubMed:11032836, ECO:0000269|PubMed:19812033}. This is the function of ALAD (aminolevulinate dehydratase, ENSG00000148218).