If software is considered speech then we can get rid of software patents.
Also, your assertion that the software is the free speech is a false-presupposition. The private key is data, and data is speech. It's no different than a book or a newspaper, except it's written in a way that only 1 person (device) can understand it.
Books are definitely speech and we have copyright laws.