Homologous structures of related species are similar: they are inherited from a common ancestor.
Mammalian forelimbs share bones derived from a common ancestor that have been adapted for different functions.
It is hard to have other explanations for forelimb bones of porpoises and whales.