Sinusoids have nice mathematical properties, but there's no law of nature that says you have to use them. Walsh transforms use square waves (actually binary rather than purely square) as basis functions and they have other handy mathematical properties.
https://en.m.wikipedia.org/wiki/Hadamard_transform