<<if it was so popular and funny, why did they make an american version of the office?>>
Simple. The UK original was extremely successful on BBC America. As is their way, the americans wanted another gazillion episodes but Ricky Gervais wanted to move on.
So he cut a deal where they bought the rights to produce their own with him as Executive Producer and writing consultant - at least for the first season, I'm not sure if he has retained a role other than financial now that the US version is so established.