Compaq created a new BIOS from a clean sheet of paper design, not a reverse engineered or ROM dump. The code of the BIOS on the PC and PC/XT were copyrighted.
I heard a tale - but can't find an online reference - for the first Compaq PC BIOS containing a bit that said 'Not (C) IBM' in order to pass some software checks searching for the strings '(C) IBM' being present at certain specific BIOS addresses.
userbinator's post clearly mentions cloning the hardware being problematic legality-wise and I was replying to that. Nobody's saying the cloned BIOS is problematic legal-wise.
Compaq wrote a specification based on IBM's published code listing. Then they handed it over to a separate team to reimplement.