I think it make sense from a cost/benefit analysis. Swift was created to make it easier for developers to write iPhone apps. Open sourcing the code provides developers with example code (given it was a brand new language), and more eyeballs to potentially look through the code to improve it whereas google open sourcing search should just allow bing to catch-up.