Your viral integration example is actually a perfect example of one where all genes indeed do a have a function, but they are not readily apparent to us. Genes that control latency may not expressed until specific conditions, and that is their function, to control expression. Some genes control integration.
I spent 5 years of my life doing my PhD studying viral replication, and the "unknown function of viral genes" was a constant topic of discussion, but we all agreed, they have a function.