Either you give an explicit reference to the data (mtcars$wt) or you provide the data and variable names separately, in that case you need to use formulas:
plot_ly(mtcars, x=~wt, y=~mpg,type = "scatter", mode = "markers")
# same result:
plot_ly(x=mtcars$wt, y=mtcars$mpg,type = "scatter", mode = "markers")
In your example, since you're not providing a formula, plot_ly assumes you're providing data. So it does exactly what you ask: it plots the character string "mpg" against the string "wt".