Coincidence, in the sense that there is no in-universe reason for the resemblance.
Shadow was designed as a deliberate dark counterpart — a marketing and design decision to give Sonic a rival with a comparable silhouette but a very different attitude. The shared shape is intentional branding; the similarities largely stop at appearance and speed.