"effort wouldn't be better expended on something of more value to society."
You mean that investigating what is dangerous to society itself is not valuable? If went unnoticed, such issues could one day trigger very big damages - computers are no longer big machines running in isolated complexes, or funny things nerds play with in their bedrooms.
Almost anything important is today run by using computers - and it will just increase. Ensuring computers and their software are safe enough is not different from ensuring cars, planes, appliances, houses, drugs, food, etc are safe.