Similarity metric for clustering
Cosine is for continuous values. It's not the most appropriate thing here.

For binary values, look at


Simple matching distance
Hamming distance
Jaccard distance
Many many many more.


Don't expect clustering to just work. If you have binary data, you only have very few bits of information. The resulting distances will show discrete steps, and clustering will likely still fail to provide good results. Roughly, you have "identical", "one difference", "two differences", and then probably everything already is connected.
It's because of the data, and a not very well defined task (what would be a good cluster?).