You raise a very important question about scientific funding from a liberal perspective. I imagine it is a controversial topic even among libertarians and I doubt there is a consensus. I imagine purists would say that scientific research should be entirely left to the private sector, while moderate liberals would argue that there should be some mechanism for funding it, such as tax breaks or vouchers. I personally believe that scientific research should be largely funded by the government because I see scientific research as an essential good, like education, health, and housing.