This is short for 'you were played for a fool' or 'played like a fiddle (or any instrument)' and means you were fooled into doing something. You were naive, or unsuspecting, and therefore taken advantage of by someone else. The 'play on words' in this expression is that you, like a musical instrument, had to 'play' the tune that someone wanted to hear: you got played by them.